Git/Bower错误:退出代码#128和连接失败

azs*_*326 84 git bower

我正在使用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依赖项的.

  • 它只是我,还是这实际上不适用于其他任何人?这是google上几乎所有与bower 128错误有关的搜索的最高结果,并且在更改此设置之后,bower仍然使用git协议. (9认同)
  • 为我工作 - 我猜测端口22在我尝试这个的工作机器上关闭了.所以没有SSH到github :(我可以说我确实从(git)项目文件夹运行命令...如果这会产生任何差异. (2认同)

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)


azs*_*326 8

端口22在我的计算机上被阻止.一旦我找到阻止它并打开端口的东西,我就可以运行bower install cmd而没有任何问题.

  • 我的apache2正在运行.我停止了服务而且工作正常. (3认同)

Hen*_*nry 6

似乎azsl1326未能在端口9418(git://)上使用bower(git),然后告诉git使用端口22(https://).这仍然失败,但随后打开端口22获得了预期的结果.

最直接的解决方案是打开端口9418.这是git://协议使用的端口.


Ign*_*rew 5

导航到您的应用程序文件夹并运行此命令

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

这应该可以解决您的问题