Search code examples
node.jsnpm

npm ERR! network getaddrinfo ENOTFOUND


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 it has something to do with proxy not being set correctly, or 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?

screenshot

C:\                             >npm install browserify
npm WARN package.json                 o description
npm WARN package.json                   repository field.
npm http GET https://registry.npmjs.org/browserify
npm http GET https://registry.npmjs.org/browserify
npm http GET https://registry.npmjs.org/browserify
npm ERR! network getaddrinfo ENOTFOUND
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 settin
gs.
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! System Windows NT 6.1.7601
npm ERR! command "C:\\Program Files (x86)\\nodejs\\\\node.exe" "C:\\Program File
s (x86)\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "browserify"
npm ERR! cwd C:\
npm ERR! node -v v0.10.26
npm ERR! npm -v 1.4.3
npm ERR! syscall getaddrinfo
npm ERR! code ENOTFOUND
npm ERR! errno ENOTFOUND
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! C:
npm ERR! not ok code 0

Solution

  • 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