Authentication 使用VST管理NPM包

Authentication 使用VST管理NPM包,authentication,npm,azure-artifacts,Authentication,Npm,Azure Artifacts,使用包管理源发布npm包时遇到问题 >vsts-npm-auth -config .npmrc vsts-npm-auth v0.25.0.0 ---------------------- Creating npmrcFile. Path: H:\.npmrc Getting new credentials for source:https://########.pkgs.visualstudio.com/_packaging/########/npm/registry/, scope

使用包管理源发布npm包时遇到问题

>vsts-npm-auth -config .npmrc


vsts-npm-auth v0.25.0.0
----------------------
Creating npmrcFile. Path: H:\.npmrc
Getting new credentials for source:https://########.pkgs.visualstudio.com/_packaging/########/npm/registry/, scope:vso.packaging_write vso.drop_write


>npm publish
...

npm ERR! need auth auth required for publishing
npm ERR! need auth You need to authorize this machine using `npm adduser`

我这里缺少什么?

解决方案是将.npmrc文件移动到用户文件夹。

该.npmrc文件(带有“\u authToken”)是由H:驱动器中的vsts npm auth-config.npmrc生成的


我手动将其移动到用户文件夹,以使npm publish工作。

运行vsts npm auth-config.npmrc命令时,是否有提示窗口允许您进行身份验证?我的步骤:1。单击连接到提要>npm 2。将registry=xxx always auth=true复制到.npmrc文件3。运行npm安装-g vsts npm auth--注册表https。。。。。4.运行vsts npm auth-config.npmrct我第一次运行该命令时,出现了一个身份验证窗口。我已经登录,没有错误。我遵循了所有这些步骤(从这里:和这里:)引用此线程以删除相关信息,然后重试。已经没有解决就跟着它走了。如果在管理控制台中执行vsts npm auth,则会有一个区别:vsts npm auth v0.25.0.0----------------------创建npmrcFile。路径:H:\.npmrc找不到路径“H:\.npmrc”的一部分。H:(网络驱动器)中已经有一个.npmrc文件,但该驱动器似乎无法从命令行访问(C:\>H:系统找不到指定的驱动器。)如果以管理员身份运行它