如何解决npm install中的身份验证错误? [英] How to resolve authentication error in npm install?
本文介绍了如何解决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?
推荐答案
如果可以,您应该:
- 通过ssh访问私有存储库
- 使用您注册的部署或受信任的密钥到您的Git远程托管服务器,以允许您的CI服务器对其进行访问.
- 配置您的.ssh/config文件,以使npm使用右键:请参阅"是否可以指定哪个ssh键应用于
npm install
"
- 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屋!
查看全文