I\'m trying to use Bower for a web app, but find myself hitting some sort of proxy issues:
D:\\>bower search jquery
bower retry Request to https:/
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 am required to run the following commands to fix the issue:
npm cache clean
bower cache clean
bower install
Please make sure there are no special characters in your proxy password. Convert it to hex. It works for me.
For Win 7.
What worked for me , are below steps as suggested at this link - read #nanowizard answer.
In .bowerrc
file, remove any http_proxy / https_proxy settings that
you might have done earlier. This is important.
So final content of this file should look like :-
{
"directory": "app/bower_components"
}
Set environment variables in your pc - http_proxy
and https_proxy
to your corporate firewall proxy. In case, your corporate proxy requires authentication and if your password contains special characters, convert it to hex form as suggested by this link. As in my case escaping of characters with '\' did not help. Also I had to restart my system.
Note : http_proxy and https_proxy should contain 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://...
The registry used in the the other answers is now deprecated. Please update it!
{
"proxy":"http://<user>:<password>@proxy.company.com:<proxy-port>",
"https-proxy":"http://<user>:<password>@proxy.company.com:<proxy-port>",
"registry": "https://registry.bower.io"
}
Thanks @user3259967
This did the job.
I would like to add that if you are behind a proxy that needs to be authenticated, you can add the username/password to your .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 the use of http:// in https-proxy
you can try suggest @thebignet into same issue on GitHub
Set proxy
, https-proxy
and strict-ssl
configuration into .bowerrc
File :
{
"proxy" : "http://<host>:<port>",
"https-proxy" : "http://<host>:<port>",
"strict-ssl" : false
}
But you must run Command from terminal:
git config --global url."https://".insteadOf git://