How to resolve authentication error in npm install?

我与影子孤独终老i 提交于 2019-12-22 17:49:57

问题


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?


回答1:


If you can, you should:

  • 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"


来源:https://stackoverflow.com/questions/44224567/how-to-resolve-authentication-error-in-npm-install

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!