How to setup Node.js and npm behind a corporate web proxy


Proxy with no authentication:

npm config set proxy http://proxy.com:8080
npm config set https-proxy http://proxy.com:8080

Proxy with authentication:

npm config set proxy http://username:password@proxy.com:8080
npm config set https-proxy http://username:password@proxy.com:8080

These examples use proxy.com as the proxy server url and 8080 for the port number.
Post a Comment