Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ETIMEDOUT Error while installing Node packages on Windows

Tags:

I am trying to install node packages on my windows machine using npm from a fresh install of node.

however, I am getting ETIMEDOUT errors. I checked few other stackoverflow questions with similar problem and almost all of them are related to problems when behind a proxy. Same is not the case with me. My system is not behind any proxy server. Can someone help me with resolving it.

PS C:\windows\system32> npm -v 2.5.1 PS C:\windows\system32> npm install bower -g npm ERR! Windows_NT 6.3.9600 npm ERR! argv "C:\\Program Files\\nodejs\\\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "i nstall" "bower" "-g" npm ERR! node v0.12.0 npm ERR! npm  v2.5.1 npm ERR! code ETIMEDOUT npm ERR! errno ETIMEDOUT npm ERR! syscall connect  npm ERR! network connect ETIMEDOUT 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 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! Please include the following file with any support request: npm ERR!     C:\windows\system32\npm-debug.log 
like image 771
EagleEye Avatar asked Feb 25 '15 15:02

EagleEye


People also ask

Why I Cannot install npm?

You need to make sure you have a package. json file right in the current directory where you run the command. Once you see there's a package. json file in the output as shown above, then you can run the npm install command.

What is Etimedout?

This is caused when your request response is not received in given time(by timeout request module option). Basically to catch that error first, you need to register a handler on error , so the unhandled error won't be thrown anymore: out.

Why npm is not working on Windows?

The Npm command not found error can appear when you install or upgrade npm. On Windows, the cause of this error could be that a PATH or system variable is not correctly set. The error can also occur if you do not have npm or Node. js installed, have an outdated version, or have permission issues.


2 Answers

I am posting this answer in case some one faces the same issue.

I was able to solve this by running following command:

npm config delete proxy 
like image 188
EagleEye Avatar answered Sep 28 '22 03:09

EagleEye


First, run npm config list and check whether you are behind a proxy. If so, try running

npm config delete proxy npm config delete http-proxy npm config delete https-proxy 

as required

**If this method did not work, reinstall nodejs.

like image 24
Nadun Kulatunge Avatar answered Sep 28 '22 03:09

Nadun Kulatunge