NPM with proxy

Just a reminder.

Most of you will have to deal with that common issue when setting npm config for http or https downloads under Windows.

basic commands

npm config set proxy http://IP_PROXY:8080 
npm config set https-proxy http://IP_PROXY:8080

Proxy most of the time involves authentication with domain, login, password.

custom commands

npm config set proxy http://login:password@IP_PROXY:8080
npm config set https-proxy http://login:password@IP_PROXY:8080

Here an example with an arbitrary domain name AD:

npm config set proxy http://AD\login:password@IP_PROXY:8080


But OMG it won’t work because of ‘\’ character.


Solution is… to url-encode it with %5C like this:

npm config set proxy http://AD%5Clogin:password@IP_PROXY:8080
npm config set https-proxy http://AD%5Clogin:password@IP_PROXY:8080

Custom password or user might also force you to encode some characters.

Wish it will help some.

One clap, two clap, three clap, forty?

By clapping more or less, you can signal to us which stories really stand out.