【问题标题】:Error - 'bower install' fail with Exit Status 1错误 - “凉亭安装”失败,退出状态为 1
【发布时间】:2014-11-02 00:20:12
【问题描述】:

在浏览angular-phonecat tutorial 时,我在运行npm install 命令后立即遇到以下错误:

我也查看了日志文件,但它或多或少地重复了控制台中显示的相同错误消息。我错过了什么?

【问题讨论】:

  • 看来是网络连接问题。你能运行命令git ls-remote --tags --heads git://github.com/angular/bower-angular-route.git吗?它应该列出所有标签
  • @shawnzhu - 当我运行命令时,我得到了fatal: unable to connect to github.com: github.com[0: 192.30.252.129]: errno=No error 这个错误是由 Github 的结束引起的(我认为不太可能)还是我的?
  • 可能是您所在位置和 github 之间的路由问题。我到达 github 没有问题。可以浏览github.com吗?
  • @TimothyStrimple - 是的,我浏览 github.com 没有问题
  • 你试过我和蒂莫西给出的解决方案了吗?

标签: javascript node.js angularjs


【解决方案1】:

我的猜测是您使用了一些限制您可以访问的端口的网络代理或防火墙。在这种情况下,您可以告诉 git 使用 https:// 而不是 git:// 进行克隆。答案基于this question

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

【讨论】:

    【解决方案2】:

    尝试让 git 使用 http 连接,而不是像这样的 git:

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

    有时 git 协议会被阻止,但 https 不会。

    引用了类似的问题here

    【讨论】:

    • 你的回答和蒂姆的一样好,但我不得不接受他的回答,因为他来得早一点。感谢您花时间回答(为您投票)。
    • Casp,我听到了。干杯! :)
    猜你喜欢
    • 2020-05-03
    • 2011-11-11
    • 1970-01-01
    • 1970-01-01
    • 2016-09-16
    • 2012-06-21
    • 2019-12-01
    • 2016-11-01
    • 2023-03-19
    相关资源
    最近更新 更多