Leo Farmer
Leo Farmer

Reputation: 7910

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?

Upvotes: 7

Views: 10117

Answers (1)

J-Dizzle
J-Dizzle

Reputation: 3191

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
}

Upvotes: 18

Related Questions