在我的 package.json 中,我有一个名为 somerepo.git 的私人存储库。现在我通过 maven 在 buildserver(bamboo) 上运行 npm install 并收到此错误:
[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
如何解决存储库的身份验证问题?
如果可以的话,您应该:
- 通过 ssh 访问私有仓库
- 使用部署或可信密钥 https://confluence.atlassian.com/bamboo/managing-trusted-keys-800714520.html您注册到 Git 远程托管服务器,以便允许 CI 服务器访问它。
- 配置您的 .ssh/config 文件以便 npm 使用正确的密钥:请参阅“有没有办法指定应该使用哪个 ssh 密钥npm install https://stackoverflow.com/a/25938257/6309"
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)