首页 > 解决方案 > GitHub 无法从 npm repo 中提取

问题描述

我已经尝试了大约 2 个小时来获得一个 repo:https ://github.com/cmelange/ECL-3D-Components#ecl-3d-components加载到我的角度项目中,但没有运气。

npm ERR!     C:\Users\tassc\AppData\Roaming\npm-cache\_logs\2020-02-04T12_35_00_266Z-debug.log
PS C:\Users\tassc\Projects\PatioCoveringModels> npm i
npm ERR! Error while executing:
npm ERR! C:\Program Files\Git\cmd\git.EXE ls-remote -h -t git://github.com/cmelange/ECL-3D-Components.git
npm ERR!
npm ERR! fatal: unable to connect to github.com:
npm ERR! github.com[0: 140.82.118.4]: errno=No such file or directory
npm ERR!
npm ERR!
npm ERR! exited with error code: 128

npm ERR!     C:\Users\tassc\AppData\Roaming\npm-cache\_logs\2020-02-04T12_56_46_865Z-debug.log

标签: angulargithubnpm

解决方案


这是一个防火墙问题。我也经常面对这个问题。以下方法对我有用。尝试以下命令并强制 npm 使用 http:// 而不是 git://。

rm -rf node_modules

rm -rf bower_components

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

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

让我们知道它是否也适合您。


推荐阅读