我正在使用Bower来安装几个库.为了演示目的,我正在安装bootstrap.无论包装如何,我都会收到以下错误:
C:\Scott>bower install bootstrap
bower not-cached git://github.com/twbs/bootstrap.git#*
bower resolve git://github.com/twbs/bootstrap.git#*
bower ECMDERR Failed to execute "git ls-remote --tags --heads git://github
.com/twbs/bootstrap.git", exit code of #128
Additional error details:
fatal: unable to access 'https://github.com/twbs/bootstrap.git/': Failed connect
to github.com:443; No error
Run Code Online (Sandbox Code Playgroud)
我已尝试使用以下解决方案删除第一个错误 - 我从此搜索中找到:
git config --global url."https://".insteadOf git://
Run Code Online (Sandbox Code Playgroud)
但是,这不起作用,也不会在该页面上找到任何其他解决方案.搜索第二个错误的解决方案,如果您在公司网络上/防火墙后面,似乎为代理服务器设置用户名/密码将解决问题.但是,我没有使用代理服务器,因为我在家用电脑/网络(Windows 7 x64).
谢谢!
编辑:命令窗口有错误:
小智 122
我知道这不是"修复"问题,但你可以使用
git config --global url."https://".insteadOf git://
告诉git使用HTTPS而不是GIT,这对我来说是安装npm依赖项的.
ant*_*njs 34
而不是运行此命令:
git ls-remote --tags --heads git://github.com/twbs/bootstrap.git
Run Code Online (Sandbox Code Playgroud)
你应该运行这个命令:
git ls-remote --tags --heads git@github.com:twbs/bootstrap.git
Run Code Online (Sandbox Code Playgroud)
要么
git ls-remote --tags --heads https://github.com/twbs/bootstrap.git
Run Code Online (Sandbox Code Playgroud)
或者你可以运行,git ls-remote --tags --heads git://github.com/twbs/bootstrap.git
但你需要让git始终以这种方式使用https:
git config --global url."https://".insteadOf git://
Run Code Online (Sandbox Code Playgroud)
参考:https://github.com/bower/bower/issues/50
Fra*_* Fu 20
我在公司网络上遇到了这个问题.
这看起来很奇怪,因为我一直在使用ssh连接git而且从来没有遇到过问题.
我尝试了https并且没有工作,所以我将代理设置添加到git的配置中,一切都很顺利
git config --global http.proxy http://proxyuser:proxypwd@proxy.server.com:8080
git config --global https.proxy https://proxyuser:proxypwd@proxy.server.com:8080
Run Code Online (Sandbox Code Playgroud)
并确保它有效
git config --list
Run Code Online (Sandbox Code Playgroud)
端口22在我的计算机上被阻止.一旦我找到阻止它并打开端口的东西,我就可以运行bower install cmd而没有任何问题.
似乎azsl1326未能在端口9418(git://)上使用bower(git),然后告诉git使用端口22(https://).这仍然失败,但随后打开端口22获得了预期的结果.
最直接的解决方案是打开端口9418.这是git://协议使用的端口.