Error : getaddrinfo ENOTFOUND


I am working on a corporate network.

Trying to install npm. But I'm getting this error again and again.

$ npm install
npm ERR! Windows_NT 6.1.7601
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program     Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install"
npm ERR! node v6.1.0
npm ERR! npm  v3.8.6
npm ERR! errno ENOTFOUND
npm ERR! syscall getaddrinfo

npm ERR! network getaddrinfo ENOTFOUND
npm ERR! network This is most likely not a problem with npm itself
npm ERR! network and is related to network connectivity.
npm ERR! network In most cases you are behind a proxy or have bad network settings.
npm ERR! network
npm ERR! network If you are behind a proxy, please make sure that the
npm ERR! network 'proxy' config is set properly.  See: 'npm help config'

npm ERR! Please include the following file with any support request:
npm ERR!     C:\Angular-test\angular-phonecat\npm-debug.log

Tried this also: npm config set registry

Still getting the same error.

This question is tagged with angularjs node.js windows npm npm-install

~ Asked on 2016-09-20 11:29:31

The Best Answer is


Things to try:

  1. make sure you have internet connection: ping
  2. make sure you have DNS resolver working: ping
  3. make sure you can access ping
  4. make sure you can connect via https.

Try in your browser:

Make sure you are trying to connect to:


and not to:

  • ""

or some other weird string composed of few hostnames, because it's weird that the resolver complains about a hostnames that includes a port number, which it shouldn't care about. Ok, I tested and it should look like this for hosts that are not found.


From your comment to this answer it seems that you are not directly connected to the internet if you can't even ping

If you are using a proxy to access the Web, then you also have to configure npm to use it. Use:

npm config set proxy
npm config set https-proxy

but instead of use what you actually need in your company - ask someone or see how your browser is configured.

To see your proxy configuration in Chrome, see this.

Update 2

If you can access in your browser but you cannot run ping then it means that your browser must be configured to use a proxy, or other programs than your browser must be restricted from using the internet.

In any case, you should ask someone in your company about it because most likely you either need to use a specific proxy or someone needs to lift the restriction from your npm and allow it to access the network.

The network access can be blocked by a firewall installed on your computer or a router in your network. It's hard to say without knowing the specific configuration in your company.

Update 3

Remove the environment variable "https_proxy" if any or use correct value for "https_proxy"

~ Answered on 2016-09-20 11:42:39


use: Make sure you are trying to connect to:

if there is no error,try to clear cache

npm cache clean --force

then try

npm install

even you have any error

npm config set registry

then try

npm install -g @angular/cli

~ Answered on 2018-06-07 04:12:55

Most Viewed Questions: