Bower call blocked by corporate proxy

I try to use Bower for a web application, but find that I am facing some proxy issues:

D:\>bower search jquery bower retry Request to https://bower.herokuapp.com/packages/search/jquery failed with ECONNRESET, retrying in 1.2s bower retry Request to https://bower.herokuapp.com/packages/search/jquery failed with ECONNRESET, retrying in 2.5s bower retry Request to https://bower.herokuapp.com/packages/search/jquery failed with ECONNRESET, retrying in 6.8s bower retry Request to https://bower.herokuapp.com/packages/search/jquery failed with ECONNRESET, retrying in 15.1s bower retry Request to https://bower.herokuapp.com/packages/search/jquery failed with ECONNRESET, retrying in 20.3s bower ECONNRESET Request to https://bower.herokuapp.com/packages/search/jquery failed: tunneling socket could not be established, cause=Parse Error 

Relevant points:

  • I can go to https://bower.herokuapp.com/packages/search/jquery and it returns the full json response.
  • I can use git for cloning using the git: // and http (s) protocol.
  • I can use NPM directly without these problems.
  • I tried using Fiddler to determine what was blocking, but it did not detect any calls from the Bower command. I see NPM command calls in Fiddler.
  • I looked for a list of Bower problems, saw similar problems, but they either do not have a solution, or it does not look like mine.

Any ideas?

+71
bower proxy
Feb 13 '14 at 9:58
source share
15 answers

Thanks @ user3259967

It did the job.

I would like to add that if you are behind a proxy server that needs to be authenticated, you can add the username / password to the .bowerrc file.

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

NOTICE of using http: // in https proxy

+145
Apr 25 '14 at 8:45
source share

The solution for me is config.bowerrc

 { "directory": "vendor", "registry": "http://bower.herokuapp.com", "proxy": "http://<user>:<pwd>@proxy.host.br:8080", "https-proxy": "http://<user>:<pwd>@proxy.host.br:8080", "strict-ssl": false } 

Using the http protocol in https-proxy and registry entries with the http protocol.

Remember to change the port number 8080 to your proxy server.

+35
Jun 05 '14 at 17:10
source share

Are you for the proxy?

Have the environment variables set HTTP_PROXY and HTTPS_PROXY?

 SET HTTP_PROXY=http://yourproxyserver:yourproxyport SET HTTPS_PROXY=http://yourproxyserver:yourproxyport 
+19
Feb 20 '14 at 23:56
source share

Try changing the registry value in your .bowerrc:

 { "registry": "http://bower.herokuapp.com" } 
+10
Mar 07 '14 at 12:09
source share

I did not have a .bowerrc file to configure the settings. I found settings living in a file called defaults.js . found in "C: \ ... \ bower \ node_modules \ bower-config \ lib \ util \ defaults.js "
Hope this helps others:

 var defaults = { 'cwd': process.cwd(), 'directory': 'bower_components', 'registry': 'http://bower.herokuapp.com', 'shorthand-resolver': 'git://github.com/{{owner}}/{{package}}.git', 'tmp': paths.tmp, 'proxy': '<<http://user:pass@proxy:port>>', // change proxy here or at the top 'https-proxy': '<<http://user:pass@proxy:port>>', // change proxy here or at the top 'timeout': 30000, 'ca': { search: [] }, 'strict-ssl': false, 'user-agent': userAgent, 'color': true, 'interactive': null, 'storage': { packages: path.join(paths.cache, 'packages'), links: path.join(paths.data, 'links'), completion: path.join(paths.data, 'completion'), registry: path.join(paths.cache, 'registry'), empty: path.join(paths.data, 'empty') // Empty dir, used in GIT_TEMPLATE_DIR among others } }; module.exports = defaults; 
+9
Jan 23 '15 at 19:49
source share

you can try offering @thebignet in the same issue on github

Install proxy , https-proxy and strict-ssl configuration in .bowerrc file:

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

But you need to execute the command from the terminal:

 git config --global url."https://".insteadOf git:// 
+5
Jun 17 '15 at 21:48
source share

For Win 7 .

What worked for me, below the steps suggested in this link - read the answer #nanowizard.

  • In the .bowerrc file .bowerrc delete all the http_proxy / https_proxy settings that you could do this earlier. It is important. Therefore, the final content of this file should look like this: -

     { "directory": "app/bower_components" } 
  • Set the environment variables on your computer - http_proxy and https_proxy to your corporate proxy server. In case your corporate proxy requires authentication, and if your password contains special characters, convert it to hexadecimal , as suggested by this link. As in my case, escaping characters with '\' did not help. I also had to reboot the system.

Note: http_proxy and https_proxy must contain the same proxy address, as shown below.

 http_proxy = http://<user>:<password>@<your company proxy>:<port> https_proxy= http://<user>:<password>@<your company proxy>:<port> ->Note no 's' in http://... 
+4
Aug 6 '15 at 10:24
source share
 "strict-ssl": false 

in.bowerrc did for me

+3
Apr 20 '16 at 13:15
source share

I am behind the corporate firewall, and I must specify the domain name. None of these answers worked for me. Here is what I did -

  • Downloaded by CNTLM from http://cntlm.sourceforge.net/
  • Obviously, it is installed.
  • Open cntml.ini and change the following

    Domain your_domain_name

    Username your_domain_username

    Password your_domain_passowrd

    PassLM 1AD35398BE6565DDB5C4EF70C0593492 (uncomment this)

    PassNT 77B9081511704EE852F94227CF48A793 (uncomment this too)

    Proxy http: // localhost: 8888

  • Go to services.msc and start the CNTLM authentication service.

  • Download Fiddler 4/2 (whatever they call).
  • Install it too. This will work in http: // localhost: 8888
  • Now, any program that you run ahead (proxy) is http: // locahost: 3128 (this is what CNTLM works.)

In this case, specify http.proxy and https.proxy as http: // localhost: 8888

This will work for other client programs. Just specify the proxy as http: // localhost: 8888

+1
Sep 10 '15 at 4:21
source share

its work for me to modify the .bowerrc file

 {
  "directory": "client / lib", 
  "registry": "http://bower.herokuapp.com",
  "proxy": "http://192.168.1.205:3228",
  "https-proxy": "http://192.168.1.205:3228"
 }
  • where client / lib is the installation directory where you want to install
  • and http://192.168.1.205:3228 is your proxy server with a port. corporate proxies may vary according to organization.
+1
02 Sep '16 at 12:48 on
source share
 { "directory": "library", "registry": "http://bower.herokuapp.com", "proxy":"http://<USERNAME>:<PASSWORD>@<PROXY_IP>:<PROXY_PORT>/", "https-proxy":"http://<USERNAME>:<PASSWORD>@<PROXY_IP>:<PROXY_PORT>/" } 

This code worked for me. I use Win 7 and chrome as well as git bash. Something needs to be cleaned up here. It takes a long time to find the actual data about username, password, proxy IP and port. I will describe it step by step so that each student can easily understand the message:

  • Create a notepad file named .bowerrc in the login folder; You can go there by typing in the menu Start> Run>% UserProfile% and click OK.
  • Enter the code above in the .bowerrc file with the following changes:

    Replace <USERNAME> with the user ID of your Internet connection or login ID

    Replace <PASSWORD> with your internet connection password or login password. Replace <PROXY_IP> and <PROXY_PORT> working IP address of the proxy and its port number.

      **Note: There should be no angle brackets.** 
  • The proxy IP address must be different from your own IP address.

  • Before using any proxy server and port, you should check if it works by changing the IP address and port of the proxy server.

  • You can view this link to find out the details of proxy settings in the description here

  • From these proxy settings, you get the proxy server and port.
  • Re-check all the input data so that everything is correct, save and close the file.
  • Open git bash and change the directory to the project file and enter the command and press enter, in my case, git bash:

a @ a-PC MINGW32 / d / conFusion

$ bower install

  1. He worked like magic.
0
Nov 27 '15 at 15:50
source share

In case this helps someone, I had a "bower blocked by group policy" error.

The decision was to make an exception in CryptoPrevent, an application installed on our company computers, to prevent cryptographic message blocking.

0
Dec 23 '15 at 16:55
source share

For information, you can add the no-proxy attribute in your .bowerrc file. I do not know since when it is supported, but it works on bower 1.7.4, and it solves the problem of talking behind a corporate proxy with internal storage.

.bowerrc:

 { "directory": "bower_components", "proxy": "http://yourProxy:yourPort", "https-proxy":"http://yourProxy:yourPort", "no-proxy":"myserver.mydomain.com" } 

Hello

0
Mar 02 '16 at 14:20
source share

Please make sure that your proxy password has no special characters. Convert it to hexadecimal. This works for me.

0
Oct 25 '16 at 6:11
source share

In addition to setting the below proxy in .bowerrc :

 { "directory": "app/bower_components", "proxy":"http://<user>:<password>@proxy.company.com:<proxy-port>", "https-proxy":"http://<user>:<password>@proxy.company.com:<proxy-port>", "http-proxy":"http://<user>:<password>@proxy.company.com:<proxy-port>", "strict-ssl": false, "registry": "http://bower.herokuapp.com" } 

I need to run the following commands to fix the problem:

 npm cache clean bower cache clean bower install 
0
May 22 '17 at 12:42
source share



All Articles