从tfs feed进行npm install(在构建过程中)给出错误:无法进行身份验证 [英] npm install from tfs feed (on build process) give error: Unable to authenticate
问题描述
我们有自己的npm软件包和使用它的项目, 我想将其发布到tfs feed-存储库中,然后从那里安装而不是从物理文件安装.
We have our own npm package and a project that uses it, I want to publish it to a tfs feed - repository and install it from there instead of from a physical file.
我将开发包从我的开发机器发布到了提要,
我在使用它的项目中更改了引用.
I published the package to the feed from my development machine,
and I changed the reference within the project that consumes it.
整个过程在我的机器上都可以正常运行,但是当我尝试在tfs中的构建过程中使用软件包时-失败,并显示错误消息:
The whole process works fine from my machine, but when I try to consume the package on a build process in the tfs - it fails with the error :
无法进行身份验证,您的身份验证令牌似乎无效.
Unable to authenticate, your authentication token seems to be invalid.
我已经在项目级别使用注册表地址创建了.npmrc
文件,并在用户目录上创建了具有凭据的另一个文件,并且在TFS计算机上也做了同样的操作.
I've created .npmrc
file at the project level with the registry address, and another file with credentials on the user directory, and I did the same on the TFS machine.
是什么导致npm安装(从我的提要中)无法在tfs计算机上工作?
What can cause the npm install (from my feed) to not work on the tfs machine?
当我在用户级.npmrc文件的注册表中添加前缀@my时,如下所示:
When I add prefix @my to the registry at the user-level .npmrc file - like this:
@my:registry=https://my-feed-address
错误更改为: 我的软件包没有可用的有效版本"
The error changes to: "No valid versions available for my-package"
推荐答案
- 将此安装在计算机中:
npm install -g vsts-npm-auth
- 运行此命令(在npmrc文件所在的目录中):
vsts-npm-auth -config .npmrc
- Install this in machine:
npm install -g vsts-npm-auth
- Run this (in the directory where npmrc file is):
vsts-npm-auth -config .npmrc
这篇关于从tfs feed进行npm install(在构建过程中)给出错误:无法进行身份验证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!