发布npm扩展时的Azure DevOps Artifacts 401错误 [英] Azure DevOps Artifacts 401 error when publishing npm extension
问题描述
我正在尝试启动并运行Azure DevOps Artifacts服务.我可以将其与DevOps生成的90天令牌一起使用,但不能与我的帐户安全性"面板生成的自定义PAT一起使用.它只是给我一个401错误.我从这里遵循了PAT的说明:
I'm trying to get Azure DevOps Artifacts service up and running. I can get it to work with the 90-day token generated by DevOps but not with a custom PAT generated by my account Security panel. It just gives me a 401 error. I followed the instructions for the PAT from here: PAT instructions
我的注册表网址为 https://pkgs.dev. azure.com/mycompany/_packaging/packages/npm/registry/
我的扩展名.npmrc文件是这样的:
My extension .npmrc file is like this:
registry=https://pkgs.dev.azure.com/mycompany/_packaging/packages/npm/registry/
always-auth=true
我的系统.npmrc是这样的:
My system .npmrc is like this:
//registry.npmjs.org/:_authToken=xxxxxxxxxxxxxxxxxxxxxxxx
//pkgs.dev.azure.com/mycompany/_packaging/packages/npm/registry/:username=mycompany
//pkgs.dev.azure.com/mycompany/_packaging/packages/npm/registry/:_password=xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
//pkgs.dev.azure.com/mycompany/_packaging/packages/npm/registry/:email=devservices@mycompany.ca
//pkgs.dev.azure.com/mycompany/_packaging/packages/npm/registry/:always-auth=true
如果有帮助,这是我用来生成PAT的设置:
If it helps, here's the settings I used to generate the PAT:
有人猜我可能在哪里出问题了吗?
Any guesses where I might be going wrong?
推荐答案
有人猜我可能在哪里出问题了吗?
Any guesses where I might be going wrong?
请尝试生成范围为打包(读写),而不是 build 权限的狭窄范围的PAT.您可以点击[显示所有范围]找到它.
Please have a try to generate a PAT with a narrow scope of "Packaging (read and write), not build permission. You could click the [show all scopes] to find it.
For more information, please refer to set up your npmrc files
这篇关于发布npm扩展时的Azure DevOps Artifacts 401错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!