Error: getaddrinfo ENOTFOUND registry.npmjs.org registry.npmjs.org-00-0043

I am working on a corporate network.

Trying to install npm. But I get 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! code ENOTFOUND npm ERR! errno ENOTFOUND npm ERR! syscall getaddrinfo npm ERR! network getaddrinfo ENOTFOUND registry.npmjs.org registry.npmjs.org:443 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 as well: npm config set registry https://registry.npmjs.org/

An error still occurs.

+16
source share
13 answers

What you need to try:

  • make sure you have an internet connection: ping 8.8.8.8
  • make sure your DNS resolver is running: ping www.google.com
  • make sure you can access registry.npmjs.org: ping registry.npmjs.org
  • make sure you can connect via https.

Try it in your browser: https://registry.npmjs.org/

Make sure you are trying to connect to:

  • registry.npmjs.org

but not:

  • "registry.npmjs.org registry.npmjs.org:443"

or some other weird string consisting of several host names, because it is strange that the resolver complains about host names, which include the port number that it should not care about. Well, I tested and should look so that the hosts were not found.

Update

From your comment on this answer, it seems that you are not directly connected to the Internet, if you cannot even ping 8.8.8.8.

If you use a proxy to access the Internet, you also need to configure npm to use it. Using:

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

but instead of http://example.com:8080 use what you really need in your company - ask someone or see how your browser is configured.

To view the proxy configuration in Chrome, see this .

Update 2

If you can get https://registry.npmjs.org/ in your browser, but you can not start ping registry.npmjs.org , then this means that your browser must be configured to use a proxy server or other programs than Your browser should be limited due to internet usage.

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

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

+23
source

First edit the NetworkManager.conf file:

 vim /etc/NetworkManager/NetworkManager.conf 

Comment this line:

 #dns=dnsmasq 

Finally

 sudo service network-manager restart sudo service docker restart 
+9
source

use: https://registry.npmjs.org/ Make sure you are trying to connect to:

registry.npmjs.org

if there is no error, try clearing the cache

flushing the npm cache --force, then try installing npm

even you have errors

Configuring the npm configuration set https://registry.npmjs.org/, then try installing npm -g @ angular / cli

+6
source

I think if the system is connected to the Internet, this could be a proxy problem

Do this to remove proxy

npm config delete proxy

+3
source

You can use this command

 npm config delete proxy 

This is because formidable susceptible to the severity of the vulnerability. So, you need to override this by running the above command.

+1
source

I tried a lot, but it worked well for me.

 npm config rm proxy npm config rm https-proxy 

Above 2 commands is enough, if this does not work, try this too.

 npm config --global rm proxy npm config --global rm https-proxy 
+1
source

If Ubuntu tries to open All Settings> Network> Network Proxy, set the method to automatic and save.

0
source

I had the same problem. The reason was the corporate proxy problem. The solution was to set the proxy setting, as @rsp says.

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

But later I encounter the same problem. This time, the reason is because my password contains a special character.

You cannot enter a password with a special character in this command

Thus, the solution is to enter a special percentage character in the password.

For example, # should provide as% 23

https://www.w3schools.com/tags/ref_urlencode.asp

0
source

I spent more than 5 hours trying to get rid of this message in Windows 8.1. Therefore, I would like to share my business and save time. I was not for a proxy ... but setting up a proxy helped solve the problem. So I went deeper and found that the problem was caused by the Comodo Firewall ... which blocked cmd since I installed the packages too quickly (disabling and even closing the Firewall did not help, which made me find the problem for so long ... it seems as if it were some other Firewall process running in the background). You may have the same problem with any other installed firewall / antivirus, so make sure cmd is not blocked by them. Good luck

0
source

I have fresh Windows 10 installed on my computer, and I tried this on the command line, and it works like a miracle:

npm config rm https-proxy

0
source

in my case, these were just intermittent problems, it seems that they did not work for several attempts, then looked at https://registry.npmjs.org (the web page worked fine), tried again, tried again, and then everything worked.

0
source

For Windows Linux Subsystem:

Restarting my WSL terminal (bash / shell) fixed the problem (however, it took several restarts and minutes).

use nslookup www.google.com or npm.org to verify connectivity.

0
source

First you need to use this command

The npm configuration sets the registry https://registry.your-registry.npme.io/

This is done so that the register of enterprises of our company becomes the default register.

You can try other solution data.

0
source

All Articles