0

我正在尝试使用 Bower 安装组件,并且我在我公司的代理后面。最初我收到以下错误,

PS C:\App> bower instal
l jquery
bower not-cached    git://github.com/jquery/jquery.git#*
bower resolve       git://github.com/jquery/jquery.git#*
bower cached        https://ajax.googleapis.com/ajax/libs/angularjs/1.2.26/angul
ar.min.js
bower validate      https://ajax.googleapis.com/ajax/libs/angularjs/1.2.26/angul
ar.min.js#*
bower ECMDERR       Failed to execute "git ls-remote --tags --heads git://github
.com/jquery/jquery.git", exit code of #128

Additional error details:
fatal: unable to connect to github.com:

在四处搜索并找到使用 https: 协议而不是 git 的替代方法后,使用以下命令,

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

在我列出配置后,

core.symlinks=false
core.autocrlf=true
color.diff=auto
color.status=auto
color.branch=auto
color.interactive=true
pack.packsizelimit=2g
help.format=html
http.sslcainfo=/bin/curl-ca-bundle.crt
sendemail.smtpserver=/bin/msmtp.exe
diff.astextplain.textconv=astextplain
rebase.autosquash=true
url.https://.insteadof=git://

即使完成所有这些步骤,我仍然再次收到上述错误。

知道我错过了什么吗?

拉吉

4

1 回答 1

1

我有同样的问题,问题是我使用的是 Cygwin。git config --global正在将配置添加到我的 Cygwin home ( ~/.gitconfig),但是当 bower 执行 git 时,它正在使用我的 Windows home ( C:\Users\name\.gitconfig) 上的配置。

复制~/.gitconfigC:\Users\name\.gitconfig解决问题。

于 2014-11-20T06:13:30.693 回答