21

When I run bower install, I get the following error:

Request to https://bower.herokuapp.com/packages/jquery failed with ETIMEDOUT, retrying in 1.8s

But when I run the same URL in the address bar of Chrome, I get the json. I don't know why it fails when I do bower install using Windows 7 command shell. I suspect it has got something to do with my workplace's proxy settings.

Anyone?

Pransh Tiwari
  • 3,983
  • 1
  • 32
  • 43
AlwaysALearner
  • 43,759
  • 9
  • 96
  • 78
  • Have you tried something like `http_proxy='proxyserver' https_proxy='proxyserver' bower install`? (where proxyserver is your proxy) – Mangled Deutz Apr 07 '14 at 15:36
  • @MangledDeutz I tried `set HTTP_PROXY=http://myproxy:8080` and `set HTTPS_PROXY=http://myproxy:8080` and it worked! Post your comment as answer below so that I can accept it! Thank you! :) – AlwaysALearner Apr 08 '14 at 05:50

7 Answers7

18

Try edit .bowerrc

"proxy":"http://<host>:<port>",
"https-proxy":"http://<host>:<port>",
"strict-ssl": false
Robert Moon
  • 1,025
  • 10
  • 17
14

Have you tried something like http_proxy='proxyserver' https_proxy='proxyserver' bower install? (where proxyserver is your proxy)

Mangled Deutz
  • 11,384
  • 6
  • 39
  • 35
  • are you setting these values in npm via "npm config set" command? – Roman May 23 '14 at 23:37
  • 2
    no, these are environment variables. Try `set HTTP_PROXY=http://myproxy:8080` on your shell (I assume you are on windows?) – Mangled Deutz May 24 '14 at 09:56
  • Thank you. That did not help me, unfortunately. I had to change the git to use the https instead of git protocol to work behind the proxy. – Roman Jun 05 '14 at 23:51
9

Getting error related to proxy when no proxy is configured: May be npm is picking up proxy.

Delete the proxy attribute from npm config and try. Use:

npm config delete proxy

This solved my problem.

mins
  • 6,478
  • 12
  • 56
  • 75
  • `npm config delete proxy` worked for me. I was getting the same error. I'm not using a proxy. I tried `npm clean cache` and `bower clean cache` but neither worked for me. Thank you my friend :) – Sparky Aug 24 '15 at 00:41
8

You need to set the new registry for bower in .bowerrc:

{
  "registry": "https://registry.bower.io"
}

The old url https://bower.herokuapp.com/ is no more available.

Matteo Alessani
  • 10,264
  • 4
  • 40
  • 57
  • Confirming that this works for me too. If there is already a .bowercc and it has "directory": "wwwroot/lib" in it, just put a comma on that line, and on the next line insert registry. – Jason Roner Jul 12 '18 at 20:22
3

In my case (Win7), this problem was fixed by providing bower with the proxy settings.

As @Robert Moon mentioned in his answer, you can place this settings in the .bowerrc file.

For proxies that require authentication you will need to provide it as follows:

http://domain\username:password@proxyserverurl:port

The back slash is particularly tricky since it needs to be escaped in the .bowerrc file

Example .bowerrc:

{
  "directory": "bower_components",
  "proxy": "http://domain%5Cusername:password@proxyserverurl:port",
  "https-proxy": "http://domain%5Cusername:password@proxyserverurl:port",
  "no-proxy":"localserver.domain.com"
}

The official documentation from Bower that mentions proxy settings:
https://bower.io/docs/config/#bowerrc-specification

0

I was also stuck with the same error. The following steps fixed the error for me:

  1. Remove any existing proxy: npm config delete proxy

Then set proxy using: npm config set proxy http://<host>:<port>

  1. You may also need to change the proxy settings for git:

    git config --global http.proxy http://<host>:<port>

  2. Now edit the .bowerrc file as described by Robert Moon

"proxy":"http://<host>:<port>", "https-proxy":"http://<host>:<port>", "strict-ssl": false

Pransh Tiwari
  • 3,983
  • 1
  • 32
  • 43
0

Prod server build bower well, but the develop server does not build, it is stop with ETIMEDOUT. The error went through when I added:

"timeout": 120000

into .bowerrc.

Info from page https://bower.io/docs/config/ helped me.

  • From Review: Hi, this post does not provide an answer to the question. Once you have sufficient [reputation](https://stackoverflow.com/help/whats-reputation) you will be able to [comment on any post](https://stackoverflow.com/help/privileges/comment). Instead, please [provide answers that don't require clarification from the asker](https://meta.stackexchange.com/questions/214173/why-do-i-need-50-reputation-to-comment-what-can-i-do-instead). – sɐunıɔןɐqɐp Jul 18 '21 at 11:37