Npm and Node.js behind proxy

If you are behind a proxy, you’ll need to tell Node about the proxy. Normally, I would expect setting HTTP_PROXY and HTTPS_PROXY environment variables to do the trick. However, in the case of node, the commands you’re after are:

npm config set proxy <HTTP_PROXY>
npm config set https-proxy <HTTPS_PROXY>

Also, you can put these commands into your .npmrc file.


Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.