解决 npm install的时候报npm ERR! exited with error code: 128

解决 npm install的时候报npm ERR! exited with error code: 128

最近项目的ci跑着跑着突然就报了这个错

npm ERR! Error while executing:
npm ERR! /usr/bin/git ls-remote -h -t git://github.com/adobe-webplatform/eve.git
npm ERR! 
npm ERR! undefined
npm ERR! exited with error code: 128

查了一下,这个npm 128的错误是因为上面执行的git ls-remote git://xxxx出错,原因是ci的机器上没有可用的ssh密钥导致用git://协议拉代码报错。
直接在npm install前加一条

git config --global url."https://".insteadOf git://

就可以了,不让用git://我们用https://

你可能感兴趣的:(解决 npm install的时候报npm ERR! exited with error code: 128)