【问题标题】:Bower calls blocked by corporate proxy and then I get errors when updating .bowerrcBower 呼叫被公司代理阻止,然后在更新 .bowerrc 时出现错误
【发布时间】:2015-07-02 13:15:41
【问题描述】:

我正在尝试通过 npm 安装 bower 以设置 angular 种子项目,但遇到了由我的公司代理引起的错误。

retry Request to https://bower.herokuapp.com/packages/angular failed with ECONNRESET, retrying in 1.2s
bower                            retry Request to https://bower.herokuapp.com/packages/angular-route failed with ECONNRESET, retrying in 1.4s
bower                            retry Request to https://bower.herokuapp.com/packages/angular-loader failed with ECONNRESET, retrying in 1.9s
bower                            retry Request to https://bower.herokuapp.com/packages/angular-mocks failed with ECONNRESET, retrying in 1.3s
bower                            retry Request to https://bower.herokuapp.com/packages/html5-boilerplate failed with ECONNRESET, retrying in 1.8s
bower                            retry Request to https://bower.herokuapp.com/packages/angular failed with ECONNRESET, retrying in 2.7s

我已尝试按照我在另一个 stack overflow post 中看到的建议来编辑我的 .bowerrc 文件以添加有关代理的详细信息。但是,一旦我这样做了,我就会收到这个错误:

/Users/t821714/Projects/customer/customer/node_modules/bower/node_modules/bower-config/lib/util/rc.js:56
        throw error;
              ^
Error: Unable to parse /Users/t821714/Projects/customer/customer/.bowerrc: Unexpected token p

更新后的 .bowerrc 如下所示:

{
  "directory": "app/bower_components",
  "registry": "http://bower.herokuapp.com",
  "proxy":"http://<USERNAME>:<PASSWORD>@<PROXY_IP>:<PROXY_PORT>/",
  "https-proxy":"http://<USERNAME>:<PASSWORD>@<PROXY_IP>:<PROXY_PORT>/",
}

谁能建议我的 .bowerrc 更新出了什么问题?或者提出解决问题的更好方法?

【问题讨论】:

    标签: angularjs node.js ssl proxy bower


    【解决方案1】:

    尝试添加我在this old github thread 上找到的以下属性

    {
        "directory": "app/bower_components",
        "registry": "http://bower.herokuapp.com",
        "proxy":"http://<USERNAME>:<PASSWORD>@<PROXY_IP>:<PROXY_PORT>/",
        "https-proxy":"http://<USERNAME>:<PASSWORD>@<PROXY_IP>:<PROXY_PORT>/",
        "strict-ssl": false
    }
    

    【讨论】:

    • "strict-ssl": false 完成了这项工作
    • 你救了我真是太棒了:)
    • 如果它可以帮助其他人,我想提一下,尽管这对我有用...我意外地遇到了这样一个事实,即我的公司网络在本地使用一个代理,而在远程工作时使用一个完全独立的代理虚拟专用网。现在我根据连接方式交换代理配置。
    猜你喜欢
    • 2014-03-12
    • 1970-01-01
    • 2019-11-14
    • 2016-07-19
    • 1970-01-01
    • 1970-01-01
    • 2014-05-12
    • 1970-01-01
    • 2012-02-13
    相关资源
    最近更新 更多