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

86

我正在使用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    

我尝试使用以下解决方案来解决第一个错误 - 我从这个搜索结果中找到的:

git config --global url."https://".insteadOf git://
然而,这并不起作用,那个页面上找到的任何其他解决方案也都无效。对于第二个错误的解决方案搜索结果表明,如果您在公司网络/防火墙后面工作,则设置代理服务器的用户名/密码将解决此问题。然而,我没有使用代理服务器,因为我在家用个人电脑/网络(Windows 7 x64)。谢谢!编辑:附带错误信息的命令行窗口:enter image description here

可能是重复的问题:Bower使用仅限https安装? - kenorb
我曾经遇到过与npm和https相关的类似问题,通过使用git config --global url."git@github.com:".insteadOf "https://github.com"解决了该问题。 - grabantot
24个回答

0

这对我有用,

将文件“libcurl.dll”复制到Git安装文件夹中(C:\ Program Files \ Git \ bin \ libcurl.dll)。将其粘贴到git.exe存在的位置(C:\ Program Files \ Git \ libexec \ git-core)。


0
我在我的Linux操作系统上发现了这个错误。 然后我解决了这个问题: 1. 打开curl日志 export GIT_CURL_VERBOSE=1 2. 克隆git存储库 3. 查找日志 4. 通过更新nss和curl来解决问题 (yum update nss nss-util nspr curl)

0
我也遇到了这个错误,通过更新git解决了。当我运行失败的git ls-remote命令时,底层错误是使用了旧版本的tls。因此,更新后的git使用了更高版本的tls。

https://git-scm.com/download/win


0

运行以下两个命令以通过您的系统授予Git访问权限

eval `ssh-agent`
ssh-add ~/.ssh/id_rsa

这些命令假定您在远程 Git 服务器(Bitbucket/GitHub/其他)上拥有 SSH 密钥


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接