Over a million developers have joined DZone.
Gold Partner

Using NPM Behind a Firewall

· DevOps Zone

Lately the proxy configuration of my network has been changed, and moved from a transparent proxy, that required no configuration, to a “standard” proxy which requires a configuration script.

Unfortunately NPM doesn’t pick up the proxy configuration of Windows, and it took me a while to understand how to download node packages via NPM, so sharing here.

Basically you just run config set option of npm to set the proxy and https-proxy config keys, like this:

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

And there you go.

Topics:

Published at DZone with permission of Simone Chiaretta , DZone MVB .

Opinions expressed by DZone contributors are their own.

{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}