Install npm proxy without using http: // to the proxy name

I installed npm and used it several times, but unfortunately I had to change my proxy server and I cannot get it to work again.

here are my past settings: (those that worked)

npm config get proxy: http://proxy-foo.foobar.com:8080

npm config get https-proxy: http://proxy-foo.foobar.com:8080

now my proxy is the name of the server, and when I use the proxy server in my browser, it works fine, but when I set the configuration in npm, it is interrupted using 'getaddrinfo ENOTFOUND'

current settings:

npm config get proxy: http://servername:8080

npm config get https-proxy: http://servername:8080

in the browser proxy, I do not use http: // in front of the server name, and I think this is what causes it. this can be a problem, and if so, you can set the proxy configuration in npm without using http: // before.

+4
source share
1 answer

You're right; npm (more precisely, request , which actually makes the selection) does take care of http:// in front of the proxy name.

The proxy parameter must be the full URL that you can visit in the browser, for example,

http://proxy.company.com:port/

or

http://1.1.1.1:1234/

if specified as an IP address.

+3
source

All Articles