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! 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 also: npm config set registry https://registry.npmjs.org/
Still getting the same error.
getaddrinfo ENOTFOUND means client was not able to connect to given address.
The public npm registry is a database of JavaScript packages, each comprised of software and metadata. Open source developers and developers at companies use the npm registry to contribute packages to the entire community or members of their organizations, and download packages to use in their own projects.
npm is configured to use the npm public registry at https://registry.npmjs.org by default.
Things to try:
ping 8.8.8.8
ping www.google.com
ping registry.npmjs.org
Try in your browser: https://registry.npmjs.org/
Make sure you are trying to connect to:
registry.npmjs.org
and not to:
"registry.npmjs.org registry.npmjs.org:443"
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 8.8.8.8.
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 http://example.com:8080 npm config set https-proxy http://example.com:8080
but instead of http://example.com:8080
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.
If you can access https://registry.npmjs.org/ in your browser but you cannot run ping registry.npmjs.org
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.
Remove the environment variable "https_proxy" if any or use correct value for "https_proxy"
use: https://registry.npmjs.org/ Make sure you are trying to connect to:
registry.npmjs.org
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 https://registry.npmjs.org/
then try
npm install -g @angular/cli
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With