Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

EAI_AGAIN when installing express from npm in Windows 7

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?

like image 261
roconmachine Avatar asked Jun 08 '15 06:06

roconmachine


People also ask

CAN node js be installed on Windows 7?

Normally old operating system needs an old version of Node. JS. you can refer to old version of Node. JS here, you can also download this one, which is tested and working fine with Win7( win7 Ultimate v6.


2 Answers

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

like image 132
roconmachine Avatar answered Jan 30 '23 05:01

roconmachine


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.

like image 39
Shubham Jain Avatar answered Jan 30 '23 04:01

Shubham Jain