git下载报未知错误,把git://替换成https://,,解决 npm install的时候报npm ERR! exited with error code: 128

npm ERR! fatal: remote error:
npm ERR! The unauthenticated git protocol on port 9418 is no longer supported.
npm ERR! Please see https://github.blog/2021-09-01-improving-git-protocol-security-github/ for more information.

解决 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://

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容