I am getting npm ERR! network getaddrinfo ENOTFOUND
error while trying to install any package using NPM. I know there are numerous threads on the same issue but
I was setting proxy as
npm config set http_proxy=http://domain:8080
instead of using the correct way
npm config set proxy http://domain:8080
First I check whether proxy is set for me or not using this :
npm config get proxy
It returned null then I run this command
npm config set strict-ssl=false
It disable strict-ssl for that cmd session.
You can see complete list of config using this
npm config list ls -l
The solution which worked for me:
npm config delete proxy
npm config get proxy
which should return null
Now, check if you are able to install the package. If not working, try manually editing the config, type: npm config edit
, remember you are in VI editor.
Add ;
before(for commenting out):
npm config set proxy http://proxy.company.com:8080
npm config set https-proxy http://proxy.company.com:8080
Save and exit the file :x
Now, try installing the packages. It should work.
Well, everybody giving their answer so I thought I write too.
I am having the same proxy issue as all others. To solve this I tried many solutions but it did not work.
Search .npmrc file name in C:\Users\your_username drive and than add this line:
http://proxy.company.com:8888
I did only this and my is solved.
Take a look at your HTTP_PROXY
and HTTPS_PROXY
environment variables.
I thought mine were set correctly, as http://username:password@proxyhost:proxyport
, but it turned out that they were actually causing the problem! After deleting those variables, and restarting the commant prompt, the npm commands worked again.
I had incorrectly typed in the address as
http://addressOfProxy.8080
instead of
http://addressOfProxy:8080
(Notice the colon before the port number 8080.)