NodeJS and Npm Proxy Settings

Leave a Comment
If you are behind the proxy, then proxy will block your package installation. It may throw errors like this.
  1. Tunneling socket could not be established cause=getaddrinfo ENOTFOUND.
  2. In most cases you are behind a proxy or have bad network settings

NodeJS and Npm Proxy Settings Error
NodeJS and Npm Proxy Settings Error

Node package manager (NPM) uses the configuration file over the environment variable we set in windows system. So we need set proxy (http-proxy, https-proxy) in the Node configuration file using following commands. 

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

If npm still have any issues then set registry using following command.


npm config set registry http://registry.npmjs.org/

If still you have any issues then close your command terminal and open it. Now try with npm install command

0 comments:

Post a Comment