Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

npm ERR! Error: connect ECONNREFUSED

I'm trying to update the npm (node package manager) using the command:

npm install npm@latest -g

but I'm getting the following error in the command prompt:

npm ERR! Windows_NT 6.1.7601 npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\ node_modules\\npm\\bin\\npm-cli.js" "install" "npm@latest" "-g"  npm ERR! node v6.9.5 npm ERR! npm  v3.10.10 npm ERR! code ECONNREFUSED npm ERR! errno ECONNREFUSED npm ERR! syscall connect  npm ERR! Error: connect ECONNREFUSED xxx.xxx.xx.xxx:xxx npm ERR!     at Object.exports._errnoException (util.js:1022:11) npm ERR! If you are behind a proxy, please make sure that the npm ERR! 'proxy' config is set properly.  See: 'npm help config' 

does someone know what this really means?
any help would be appreciated.

like image 487
NickJS Avatar asked Feb 21 '17 15:02

NickJS


People also ask

Why can't I connect to my NPM server?

I think this issue is caused by an unreachable proxy on the local network. Anybody comes across similar issues, make sure that the proxy server software is up and running on the designated proxy server machine on the local network and is listening to the correct port # as configured in the npm configuration.

Why can't I run NPM err from behind a proxy?

If you are behind a proxy, please make sure that the npm ERR! 'proxy' config is set properly. See: 'npm help config' npm ERR!

How long does it take for nodejs error connect econnrefused to work?

Here it's my success story with incredible persistant Node.js error connect ECONNREFUSED . Day 1. I run this code, and should work fine. Usual errors, maybe 3-4 minutes. I changed host: 'localhost' to host : '127.0.0.1', port: 8080, or maybe 8000, oh yes, 3306 this is.

What does econnrefused error code mean?

ECONNREFUSED error means that connection could not be made with the target service (in your case localhost:8080 ). Check your service running on port 8080. To know more about node.js errors, refer this doc.


1 Answers

Try:

npm config set proxy null npm config set https-proxy null npm config set registry http://registry.npmjs.org/ 

The first two lines will remove proxy's if there any.

Third line will make npm download from the official package registry.

like image 99
Ridd Avatar answered Sep 30 '22 17:09

Ridd