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:
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.