npm install时使用git协议无法获取资源错误

npm中有些库需要从github上拉取,报错信息中提示:

/bin/git ls-remote -h -t git://github.com/adobe-webplatform/eve.git

fatal: unable to connect to github.com:

github.com[0: 20.205.243.166]: errno=Connection timed out

 

强制git使用https协议取代git协议可解决:

git config --global url."https://github.com/".insteadOf git@github.com:

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

posted @ 2022-12-06 14:22  huorexiaji  阅读(437)  评论(0)    收藏  举报