发布 npm 扩展时出现 Azure DevOps Artifacts 401 错误 [英] Azure DevOps Artifacts 401 error when publishing npm extension

查看:34
本文介绍了发布 npm 扩展时出现 Azure DevOps Artifacts 401 错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试启动并运行 Azure DevOps Artifacts 服务.我可以让它与 DevOps 生成的 90 天令牌一起使用,但不能与我的帐户安全面板生成的自定义 PAT 一起使用.它只是给了我一个 401 错误.我按照此处的 PAT 说明进行操作:

猜猜我哪里出错了?

解决方案

猜猜我哪里出错了?

请尝试生成具有打包(读取和写入)"权限而不是构建权限的狭窄范围的 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

My registry url is https://pkgs.dev.azure.com/mycompany/_packaging/packages/npm/registry/

My extension .npmrc file is like this:

registry=https://pkgs.dev.azure.com/mycompany/_packaging/packages/npm/registry/
always-auth=true

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

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?

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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆