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.
This question is related to
angularjs
node.js
windows
npm
npm-install
I spent over 5 hours trying to get rid of this message under Windows 8.1. So I would like to share my case and save someones time. I was not behind the proxy... but setting proxy helped to resolve the problem. So I go deep and found that issue was caused by Comodo Firewall... which blocked cmd since I was installing packages too fast (turning off and even closing Firewall did not help, which caused me so long to find the issue... seems like there was some other process of Firewall running in background). You may have same issue with any other firewall/antivirus installed so make sure that cmd is not blocked by them. Good luck!
use: https://registry.npmjs.org/ 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 https://registry.npmjs.org/
then try
npm install -g @angular/cli
npm config set registry https://registry.npmjs.org/
this is the only solution for me.
For Windows Subsystem Linux:
Restarting my WSL terminal (bash/shell) fixed the issue (it took a few restarts and minutes, however).
use nslookup www.google.com or npm.org to check connectivity.
First you need to use this command
npm config set registry https://registry.your-registry.npme.io/
This we are doing to set our companies Enterprise registry as our default registry.
You can try other given solutions also.
First, edit NetworkManager.conf file:
vim /etc/NetworkManager/NetworkManager.conf
Comment this line:
#dns=dnsmasq
Finally
sudo service network-manager restart
sudo service docker restart
If Ubuntu try opening All Settings > Network > Network proxy set the method to automatic and save.
I tried many but this worked fine for me.
npm config rm proxy
npm config rm https-proxy
above 2 commands is enough if it doesn't work try this as well.
npm config --global rm proxy
npm config --global rm https-proxy
I had the same issue. The reason was the corporate proxy issue. 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 face the same issue. This time reason was my password contains a special character.
In this command you can’t provide a password with special character
. So solution is to provide percentage encoded special character in the password.
For example # has to provide as %23
I have a fresh Windows 10 installed on my PC and tried this on the command line and it works like a charm:
npm config rm https-proxy
You can use this command
npm config delete proxy
It happens because formidable
is prone to severity vulnerability. So, you need to override that by running the above command.
If you are working behind proxy you must set proxy for npm to connect it to repo.
npm config set registry http://registry.npmjs.org/
npm config set proxy http://myusername:[email protected]:8080
npm config set https-proxy http://myusername:[email protected]:8080
npm config set strict-ssl false
set HTTPS_PROXY=http://myusername:[email protected]:8080
set HTTP_PROXY=http://myusername:[email protected]:8080
Note If your password contains special character like @ EX: password : mypwd1@xyz then use %40 in place of @ Ex:
npm config set proxy http://myusername:mypwd1%[email protected]:8080
in my case it was just an intermittent issues it seems, didn't work for a few tries, then looked at https://registry.npmjs.org (webpage worked fine), tried again, tried again and then it worked.
As I think if system is connected to the internet then it's may be an issue of proxy
Do this to delete proxy
npm config delete proxy
Source: Stackoverflow.com