当我运行npm install
时,大多数模块都配置正确。然而,至少有一个人想要点击一个ssh://
地址来提取模块。不幸的是,我的公司有一项不允许内部网络之外的SSH连接的政策。
我遇到的具体错误是:
Error while executing:
npm ERR! C:\Program Files\Git\cmd\git.EXE ls-remote -h -t ssh://git@github.com/pemrouz/buble.git
npm ERR!
npm ERR! ssh: connect to host github.com port 22: Connection timed out
npm ERR! fatal: Could not read from remote repository.
npm ERR!
npm ERR! Please make sure you have the correct access rights
npm ERR! and the repository exists.
npm ERR!
npm ERR! exited with error code: 128
我没有在我的package.json中定义buble,所以它显然是一个其他依赖的库。
是否有办法将NPM配置为不使用ssh://地址?我想我应该能够像其他所有的那样从HTTP地址下载模块--我能告诉它始终从SSH转换到HTTP吗?
我尝试过一些我在网上找到的东西:
git config --global url."https://".insteadOf ssh://
和npm config set ssl-strict=false
这些并没有解决这个问题。
发布于 2020-07-22 16:12:45
我尝试了一些我在网上找到的东西: git -全局url."https://".insteadOf ssh://
实际命令如下:
git config --global url."https://github.com".insteadOf ssh://git@github.com
否则,Git将尝试像https://git@github.com
这样的URL,这可能得不到很好的支持。
npm
仍然提到SSH,然后检查运行npm
命令的用户:它需要与执行全局配置的用户相同。
https://stackoverflow.com/questions/61068174
复制相似问题