1

Trying to run npm install -g "something". But I'm getting this error.

I'm working on Windows 7:

npm ERR! code ENOTFOUND
npm ERR! errno ENOTFOUND
npm ERR! network request to https://registry.npmjs.org/yarn failed, reason: 
getaddrinfo ENOTFOUND example.com example.com:8080
npm ERR! network This is a problem 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! A complete log of this run can be found in:
npm ERR!     C:\Users\User\AppData\Roaming\npm-cache\_logs\2019-03- 
01T13_13_42_425Z-debug.log

I see the file content when I open this URL on Chrome https://registry.npmjs.org/yarn

Can anyone help me to resolve this?

Kadmos B
  • 241
  • 1
  • 5
  • 17

2 Answers2

1

After a lot of research finally I found how to solve this issue.

From start I was trying to remove the proxy with npm

npm config rm proxy
npm config rm https-proxy

But for some reason it wasn't successful.

I found the proxy urls in this file C:\Users\User\.npmrc

https-proxy=http://example.com:8080
proxy=http://example.com:8080/

Removing these manually solved the issue and I was able to install any app with npm.

Kadmos B
  • 241
  • 1
  • 5
  • 17
0

Mostly (and for me as well) this error is due to incorrect proxy settings. Verify network proxy settings are correct.

Else try removing proxy settings using below commands and try again.

Console $ npm config rm proxy $ npm config rm https-proxy

Developer_99
  • 135
  • 1
  • 7
  • 17