Set/UnSet npm behind the proxy server

If your server internet access is through a proxy server, you will need to modify the npm config. After that, your npm modules installation would work properly.

Set Proxy with NPM
npm config set proxy http://<username>:<password>@<proxy-url>:<port>
npm config set https-proxy http://<username>:<password>@<proxy-url>:<port>


Sometimes no need to include Username:Password for proxy URL.

Preview proxy setting in NPM Config
npm config list

Test the npm module installation from the internet
npm install @hapi/hapi i -g

Unset Proxy with NPM

npm config unset proxy http://<username>:<password>@<proxy-url>:<port>
npm config unset https-proxy http://<username>:<password>@<proxy-url>:<port>

That’s it. I hope this will help. 🙂
Photo: NPM icon icon by Icons8

Leave a Reply

Your email address will not be published. Required fields are marked *