EAI_AGAIN when installing express from npm in Windows 7

24.3k Views Asked by At

I am using Windows 7 for development. I installed node.js 0.12.4 and npm is 2.10.1.

now i execute

npm intall express --save

but face the following error message:

npm ERR! Windows_NT 6.1.7601
npm ERR! argv "c:\\Program Files\\nodejs\\node.exe" "c:\\Program Files\\nnode_modules\\npm\\bin\\npm-cli.js" "install" "express" "--save"
npm ERR! node v0.12.4
npm ERR! npm  v2.10.1
npm ERR! code EAI_AGAIN
npm ERR! errno EAI_AGAIN
npm ERR! syscall getaddrinfo

npm ERR! getaddrinfo EAI_AGAIN
npm ERR!
npm ERR! If you need help, you may report this error at:
npm ERR!     <https://github.com/npm/npm/issues>

npm ERR! Please include the following file with any support request:
npm ERR!     d:\meandev\chat\npm-debug.log

Can anyone help?

3

There are 3 best solutions below

0
On

In my case rebooting server and trying again worked.

0
On

Updating npm worked for me.

For OSX, Linux - npm install -g npm@latest

For Windows -
Step-1 : Navigate to %ProgramFiles%\nodejs\node_modules\npm and copy the npmrcfile to another folder or the desktop. Then open cmd.exe and run the following commands:

cd %ProgramFiles%\nodejs
npm install npm@latest

Step-2 : Copy the npmrc file back into %ProgramFiles%\nodejs\node_modules\npm.

0
On

I found solution here.

Its a network issue. in my previous network there is a proxy setting. i have tried to install it without proxy it worked fine.

reference https://github.com/npm/npm/issues/7348