Monday, September 29, 2014

Configure Pip and Npm Behind a Proxy

In Linux;

It's a must to set your HTTP_PROXY and HTTPS_PROXY env
export HTTP_PROXY=http://proxy.mycompany.com:3333
export HTTPS_PROXY=http://proxy.mycompany.com:3333
It's also a must for Windows environment to set those variables

for pip
pip install package
Is enough, although
pip --proxy http://proxy.mycompany.com:3333 install package
also can do the trick

For npm

Nope, the variables can't work. Npm use a configuration file and it can be added via command line npm config set
npm config set proxy http://proxy.mycompany.com:3333
npm config set https-proxy http://proxy.mycompany.com:3333

and do the job
npm install package

They say that NodeJS faster than Python?

No comments:

Post a Comment