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 could not find any thread which can help me.
I have set the proxy & I think its something to do with proxy not being set correctly\not using the correct url.
npm config set proxy http://proxy.company.com:8080
npm config set https-proxy http://proxy.company.com:8080
Is there any way to check the URL I am using while setting proxy is correct? Are there any steps I need to take in order rectify this issue?
I got the exact same error and this is what i did.
and it returned "null"
Opened "C:\Users\Myname.npmrc" in a notepad and made some changes. This is how my .npmrc file looks now
I had incorrectly typed in the address as
instead of
(Notice the colon before the port number 8080.)
for some reason my error kept pointing to the "proxy" property in the config file. Which was misleading. During my troubleshooting I was trying different values for the proxy and https-proxy properties, but would only get the error stating to make sure the proxy config was set properly, and pointing to an older value.
Using, NPM CONFIG LS -L command lists all the properties and values in the config file. I was then able to see the value in question was matching the https-proxy, therefore using the https-proxy. So I changed the proxy (my company uses different ones) and then it worked. figured I would add this, as with these subtle confusing errors, every perspective on it helps.
I was setting proxy as
instead of using the correct way
does your proxy require you to authenticate? because if it does, you might want you configure your proxy like this.
placeholder names. username is a placeholder for your actual username. password is a placeholder for your actual password. proxy.company.com is a placeholder for your actualy proxy *port" is your actualy port the proxy goes through. its usualy 8080
strict-ssl=false