Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Bower calls blocked by corporate proxy and then I get errors when updating .bowerrc

I'm trying to install bower via npm to set up the angular seed project but am running into errors that are caused by my corporate proxy.

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

I have tried to follow the advice I saw in another stack overflow post to edit my .bowerrc file to add details about the proxy. However, once I have done this I get this error:

/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

The updated .bowerrc looks like this:

{
  "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>/",
}

Can anyone suggest what is going wrong with my .bowerrc update? Or suggest a better way to fix the issue?

like image 469
Leo Farmer Avatar asked Apr 24 '15 04:04

Leo Farmer


1 Answers

Try adding the following property that I found on 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
}
like image 68
J-Dizzle Avatar answered Oct 10 '22 07:10

J-Dizzle