【问题标题】:Bower not installing from bower.jsonBower 未从 bower.json 安装
【发布时间】:2014-12-16 20:38:11
【问题描述】:

我被困在公司防火墙/代理地狱...我正在尝试从我的 bower.json 文件安装我的依赖项,但遇到了这个错误:

bower jquery#~2.1.1            ECMDERR Failed to execute "git ls-remote --tags --heads https://github.com/jquery/jquery.git", exit code of #128

Additional error details:
fatal: unable to access 'https://github.com/jquery/jquery.git/': Failed connect to github.com:443; No error

我用谷歌搜索了这个并找到了很多答案,并尝试了以下方法,但似乎没有一个能解决我的问题。

我已经使用以下内容设置了我的 git 配置:

url.http://.insteadof=git://
url.https://.insteadof=git://

我使用 CNTLM 管理我的代理凭据,因此我的代理设置如下所示:

http.proxy=http://127.0.0.1:53128/
https.proxy=http://127.0.0.1:53128/

我的 NPM 配置中的以下内容:

http_proxy = "http://127.0.0.1:53128/"
https-proxy = "http://127.0.0.1:53128/"
https_proxy = "http://127.0.0.1:53128"
proxy = "http://127.0.0.1:53128/"
registry = "http://registry.npmjs.org/"
strict-ssl = false

我在 .bowerrc 文件中设置了以下内容:

"proxy":"http://127.0.0.1:53128",
"https-proxy":"http://127.0.0.1:53128",
"strict-ssl":false

我认为这就是一切,当我尝试bower list 时收到类似的错误消息。

我所有的 git 命令(例如克隆)都可以通过代理。这就是让我认为这是一个凉亭配置问题的原因,但我在这方面找不到很多帮助。

提前致谢。

【问题讨论】:

  • 确保对于任何 https 代理 url,您使用的是 http url,而不是 https:https.proxy=http://127.0.0.1:53128/(不是https://...)。解决这个问题,看看是否会有所作为。
  • 嗨@VonC,感谢您的建议,我已将所有这些条目更改为http,但不幸的是这并没有解决问题。
  • 我看到你说原始 git 命令有效;你确定这些命令是通过 https 运行的吗?我只问是因为 git 也可以在 ssh 上运行,如果你在 ssh 上运行,它不会受到代理的影响。无论如何,这可以解释为什么 raw git 可以工作,而 bower 不能。
  • 感谢"strict-ssl":false你帮了我很多忙 :)

标签: node.js git proxy bower


【解决方案1】:

在 Windows cmd 行中,我将代理环境变量设置为这样

> set https_proxy=http://10.1.56.10:80/   
> set http_proxy=http://10.1.56.10:80/

然后我就能够获得我的依赖项

【讨论】:

  • 感谢您的建议,我试过了,但没有成功。
【解决方案2】:

我看到了类似的问题,发现它与 .bowerrc 文件有关。

我把我的改成这样,效果很好:

{
    "proxy":"http://127.0.0.1:53128",
    "https-proxy":"http://127.0.0.1:53128",
    "registry": "http://bower.herokuapp.com",
    "strict-ssl":false
}

【讨论】:

    猜你喜欢
    • 2017-11-23
    • 2015-09-02
    • 1970-01-01
    • 1970-01-01
    • 2015-05-02
    • 1970-01-01
    • 2015-08-11
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多