如何解决npm install中的身份验证错误? [英] How to resolve authentication error in npm install?

查看:735
本文介绍了如何解决npm install中的身份验证错误?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的package.json中,我有一个名为somerepo.git的私人仓库.现在,我通过maven在buildserver(bamboo)上运行npm安装,并得到以下错误:

In my package.json I have private repo called somerepo.git. Now I am running an npm install on a buildserver(bamboo) through maven and getting this error:

[ERROR] npm ERR! Command failed: git clone --template=/var/home/ci/.npm/_git-remotes/_templates --mirror https://somerepo.git
[ERROR] npm ERR! fatal: Authentication failed for https://somerepo.git

如何解决存储库的身份验证?

How can I resolve the authentication for the repository?

推荐答案

如果可以,您应该:

  • access the private repo through ssh
  • use a deploy or trusted key that you register to your Git remote hosting server, in order to allow your CI server to access it.
  • configure your .ssh/config file in order for npm to use the right key: see "Is there a way to specify which ssh key should be used for npm install"

这篇关于如何解决npm install中的身份验证错误?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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