Reputation: 963
When I try to run the following command npm i [email protected] -save behind the proxy i get the ERR! code ETIMEDOUT error.
I have been getting this error when I am not logged on to the VPN. Now I have attempted all methods. Setting and Unsetting the proxies numerous times. Logging on and off the VPN with the proxies set/unset. no luck.
One thing I have noticed though is when I set the proxies and I have not logged on the vpn I get that error above (ERR! code ETIMEDOUT) but when I log on to the VPN and run the command I get a different error this time which is:
npm ERR! code EMAXREDIRECT npm ERR! maximum redirect reached at: https:// registry.npmjs.org/registry.npmjs.org:
What do I need to do to get npm to successfully complete this command npm i [email protected] -save. So frustrating this is, been at it for a couple of hours and I feel like putting this thing in the bin but I don't own it.
Different proxy methods I have tried
npm config set proxy http: //username:[email protected]:
npm config set https-proxy http: //username:[email protected]:
npm config set proxy http:// username:[email protected]
npm config set https-proxy http:// username:[email protected]
npm config set proxy http:// companyvpn.xx.xx
npm config set https-proxy http:// companyvpn.xx.xx
you would expect the first set of config to work but NO.Eventually I ran out of ideas
Upvotes: 0
Views: 1989
Reputation: 11
I tried with npm config set https-proxy http://proxy:8080 It worked for me
Upvotes: 1
Reputation: 963
Eventually I resorted to doing the install manually (downloading from github). It turns out that the problem had nothing to do with the npm config.
To fix this, the machine had some Enviroment Variables that are confingured for HTTP and HTTPS_PROXY. Before I was configuring these to match those of the npm config but no success.
What I did was delete these variables, they can be accessed via settings "Edit environment variables for your account". On windows > "Type here to search" located bottom left next to windows menu.
I deleted these variables and deleted the npm proxy config settings as well and then logged on to the company vpn, run npm and it was successful.
Behind the vpn proxy, I now only need to config npm with the company vpn and port number like so:
npm config set proxy http:// companyvpn.xx.xx:portNumber
npm config set https-proxy http:// companyvpn.xx.xx:portNumber
Some companies require adding username and password, some don't
Upvotes: 0