DevOps Zone is brought to you in partnership with:

Simone Chiaretta is a Software Architect and Developer from Milano, Italy that enjoys sharing via his blog his development experiences and more than decennial knowledge on web development with ASP.NET and other web technologies. He is Microsoft MVP in ASP.NET and he has been involved in many Open Source projects, but now he focuses only on SubText and taking it to the next level. He just wrote a book: Beginning ASP.NET MVC, published by Wrox Simone is a DZone MVB and is not an employee of DZone and has posted 67 posts at DZone. You can read more from them at their website. View Full User Profile

Using NPM Behind a Firewall

07.27.2013
| 3847 views |
  • submit to reddit

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.

Published at DZone with permission of Simone Chiaretta, author and DZone MVB. (source)

(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)