7

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?

Community
  • 1
  • 1
Leo Farmer
  • 7,730
  • 5
  • 31
  • 47

1 Answers1

18

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
}
J-Dizzle
  • 3,176
  • 6
  • 31
  • 49
  • 1
    "strict-ssl": false did the job – codeMan May 25 '16 at 14:35
  • thats really awesome you saved me :) – Vinod Louis Dec 12 '16 at 09:57
  • In case it helps someone else I wanted mention that although this worked for me... I unexpectedly encountered the fact that my corporate network uses one proxy when on premise and a completely separate one when working remotely over VPN. Now I swap proxy configs depending on which way I am connected. – Shawn Aug 03 '17 at 19:08