help icon indicating copy to clipboard operation
help copied to clipboard

npm ERR! code: 'ECONNREFUSED',

Open CXX22 opened this issue 5 years ago • 31 comments

npm

Hello everyone,

Please I need an assistance in fixing my npm usage.

I am using vs code and have installed node js but noticed whenever I try to npm installation on the terminal, I am shown some error notifications. I have updated, set and gotten proxy, set and gotten a registry but still to not avail, I have also cleared the cache but still having same error.

The following are what pops up whenever I try to install using npm:

npm ERR! code ECONNREFUSED npm ERR! errno ECONNREFUSED npm ERR! FetchError: request to https://registry.npmjs.org/lite-server failed, reason: connect ECONNREFUSED 10.32.47.71:80 npm ERR! at ClientRequest.req.on.err (C:\Program Files\nodejs\node_modules\npm\node_modules\node-fetch-npm\src\index.js:68:14) npm ERR! at ClientRequest.emit (events.js:189:13) npm ERR! at onerror (C:\Program Files\nodejs\node_modules\npm\node_modules\agent-base\index.js:100:9) npm ERR! at callbackError (C:\Program Files\nodejs\node_modules\npm\node_modules\agent-base\index.js:122:5) npm ERR! at process._tickCallback (internal/process/next_tick.js:68:7) npm ERR! { FetchError: request to https://registry.npmjs.org/lite-server failed, reason: connect ECONNREFUSED 10.32.47.71:80 npm ERR! at ClientRequest.req.on.err (C:\Program Files\nodejs\node_modules\npm\node_modules\node-fetch-npm\src\index.js:68:14) npm ERR! at ClientRequest.emit (events.js:189:13) npm ERR! at onerror (C:\Program Files\nodejs\node_modules\npm\node_modules\agent-base\index.js:100:9) npm ERR! at callbackError (C:\Program Files\nodejs\node_modules\npm\node_modules\agent-base\index.js:122:5) npm ERR! at process._tickCallback (internal/process/next_tick.js:68:7) npm ERR! message: npm ERR! 'request to https://registry.npmjs.org/lite-server failed, reason: connect ECONNREFUSED 10.32.47.71:80', npm ERR! type: 'system', npm ERR! errno: 'ECONNREFUSED', npm ERR! code: 'ECONNREFUSED', npm ERR! stack: npm ERR! 'FetchError: request to https://registry.npmjs.org/lite-server failed, reason: connect ECONNREFUSED 10.32.47.71:80\n at ClientRequest.req.on.err (C:\Program Files\nodejs\node_modules\npm\node_modules\node-fetch-npm\src\index.js:68:14)\n at ClientRequest.emit (events.js:189:13)\n at onerror (C:\Program Files\nodejs\node_modules\npm\node_modules\agent-base\index.js:100:9)\n


Please kindly give me the step by step guide in resolving this issue. [email protected]

CXX22 avatar May 02 '19 10:05 CXX22

@VivaRunor Looks like on your system registry.npmjs.org resolves to 10.32.47.71 which is a private ip address. Can you check your DNS pls.

On my system registry.npmjs.org resolves to 104.16.17.35 a public ip address.

preveen-stack avatar May 04 '19 14:05 preveen-stack

I'm trying my best but not yielding any positive result but errors

On 4 May 2019 15:29, "Preveen P" [email protected] wrote:

@VivaRunor https://github.com/VivaRunor Looks like on your system registry.npmjs.org resolves to 10.32.47.71 which is a private ip address. Can you check your DNS pls.

On my system registry.npmjs.org resolves to 104.16.17.35 a public ip address.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/nodejs/help/issues/1887#issuecomment-489331923, or mute the thread https://github.com/notifications/unsubscribe-auth/ALKBGF7A7EIBCZECIDTZEA3PTWMUJANCNFSM4HJ5EIYQ .

CXX22 avatar May 06 '19 09:05 CXX22

Can you please post the results of the following command on your system

ping -c 4 registry.npmjs.org

On my system the results look like this

PING registry.npmjs.org (104.16.22.35): 56 data bytes 64 bytes from 104.16.22.35: icmp_seq=0 ttl=55 time=27.237 ms 64 bytes from 104.16.22.35: icmp_seq=1 ttl=55 time=23.215 ms 64 bytes from 104.16.22.35: icmp_seq=2 ttl=55 time=24.693 ms 64 bytes from 104.16.22.35: icmp_seq=3 ttl=55 time=23.407 ms

--- registry.npmjs.org ping statistics --- 4 packets transmitted, 4 packets received, 0.0% packet loss round-trip min/avg/max/stddev = 23.215/24.638/27.237/1.605 ms

ghost avatar May 07 '19 08:05 ghost

@wide4head thanks for the followup.

I tried what you suggested and I was told: Access denied. Option -C requires administrative privileges.

I did this on vs code terminal and my command prompt terminal. I even run my cmd as an administrator but still denied access

CXX22 avatar May 07 '19 08:05 CXX22

@VivaRunor please use lower case letter -c option and not the upper case one

ghost avatar May 07 '19 08:05 ghost

@VivaRunor Oh, I forgot that you are on windows.

You only need

ping registry.npmjs.org

ghost avatar May 07 '19 08:05 ghost

Alright. Let me try. Please kindly reach me via email [email protected]

CXX22 avatar May 07 '19 08:05 CXX22

Although, my system is not having internet presently. There's a disruption some minutes ago in my server.

I tried ping registry.npmjs.org and was told ping request could not find host registry.npmjs.org

Does ping work without internet plz?

CXX22 avatar May 07 '19 08:05 CXX22

@VivaRunor But the whole point of conversing through github comments in the nodejs/help repository is that the conversation is potentially helpful to other people with similar problems.

Sorry. the ping command will not work without the internet ;-)

ghost avatar May 07 '19 08:05 ghost

I know. I wanna share something with you via email so you use to assist me

CXX22 avatar May 07 '19 08:05 CXX22

@VivaRunor go ahead and share in the comments so that other people, with far more experience than I have, can potentially help out

ghost avatar May 07 '19 08:05 ghost

You arent serious. I should share my personal details with you publicly cos I need speedy assistance?

You can go

On 7 May 2019 09:53, "Preveen Padmanabhan" [email protected] wrote:

@VivaRunor https://github.com/VivaRunor go ahead and share in the comments so that other people, with far more experience than I have, can potentially help out

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/nodejs/help/issues/1887#issuecomment-489994294, or mute the thread https://github.com/notifications/unsubscribe-auth/ALKBGF7T7A5U7W6PRIJ4C6DPUE7PXANCNFSM4HJ5EIYQ .

CXX22 avatar May 07 '19 08:05 CXX22

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.

More about proxy configuration can be found in https://docs.npmjs.com/misc/config

Also https://jjasonclark.com/how-to-setup-node-behind-web-proxy/ http://luxiyalu.com/how-to-remove-all-npm-proxy-settings/

ghost avatar May 07 '19 09:05 ghost

I started attempting to fix this issue since last week. I tried updating the proxy, getting and setting it according to some steps I followed on stackoverflow, I have also cleared the cache but to no avail.

Now, I need someone with teamviewer to help check. That's all

On 7 May 2019 10:11, "Preveen Padmanabhan" [email protected] wrote:

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.

More about proxy configuration can be found in https://docs.npmjs.com/misc/config http://url

Also https://jjasonclark.com/how-to-setup-node-behind-web-proxy/ http://url http://luxiyalu.com/how-to-remove-all-npm-proxy-settings/ http://url

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/nodejs/help/issues/1887#issuecomment-490000595, or mute the thread https://github.com/notifications/unsubscribe-auth/ALKBGF6L4AY2DFWC4PWJZNTPUFBTRANCNFSM4HJ5EIYQ .

CXX22 avatar May 07 '19 09:05 CXX22

Github

With internet, that's what I got. @wide4head

CXX22 avatar May 08 '19 09:05 CXX22

@VivaRunor - is this still an issue?

If so, the fact that registry.npmjs.org is not getting resolved is critically blocking our progress. But unfortunately, I don't think I can help you here. This issue needs to be diagnosed and resolved with the help of someone with windows system admin skills.

gireeshpunathil avatar Jun 24 '19 06:06 gireeshpunathil

Quite a long time for you to reply. Incredible

On Mon, 24 Jun 2019, 07:19 Gireesh Punathil <[email protected] wrote:

@VivaRunor https://github.com/VivaRunor - is this still an issue?

If so, the fact that registry.npmjs.org is not getting resolved is critically blocking our progress. But unfortunately, I don't think I can help you here. This issue needs to be diagnosed and resolved with the help of someone with windows system admin skills.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/nodejs/help/issues/1887?email_source=notifications&email_token=ALKBGF7MHW3BGCKQHQFBWU3P4BRQ3A5CNFSM4HJ5EIY2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODYL4HNQ#issuecomment-504873910, or mute the thread https://github.com/notifications/unsubscribe-auth/ALKBGF75N3PK34DT3IFYF4TP4BRQ3ANCNFSM4HJ5EIYQ .

CXX22 avatar Jun 24 '19 06:06 CXX22

@VivaRunor - yes, I see that the last update was more than a month back. is this resolved in between?

gireeshpunathil avatar Jun 24 '19 06:06 gireeshpunathil

No, it is not. Are you on whatsapp?

On Mon, 24 Jun 2019, 07:49 Gireesh Punathil <[email protected] wrote:

@VivaRunor https://github.com/VivaRunor - yes, I see that the last update was more than a month back. is this resolved in between?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/nodejs/help/issues/1887?email_source=notifications&email_token=ALKBGF4YC4I4OJIMQ5YT3MDP4BVBDA5CNFSM4HJ5EIY2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODYL6CMA#issuecomment-504881456, or mute the thread https://github.com/notifications/unsubscribe-auth/ALKBGFZDAI3KVKIWPMQ3NKTP4BVBDANCNFSM4HJ5EIYQ .

CXX22 avatar Jun 24 '19 06:06 CXX22

sorry, I am not. but let me try to contact you through email, if that helps

gireeshpunathil avatar Jun 24 '19 06:06 gireeshpunathil

No problem. Do you use teamviewer? If yes, what about connecting to my system to help try to fix it?

On Mon, 24 Jun 2019, 07:53 Gireesh Punathil <[email protected] wrote:

sorry, I am not. but let me try to contact you through email, if that helps

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/nodejs/help/issues/1887?email_source=notifications&email_token=ALKBGFYITKSMLIUZWO6RY73P4BVP5A5CNFSM4HJ5EIY2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODYL6KTA#issuecomment-504882508, or mute the thread https://github.com/notifications/unsubscribe-auth/ALKBGFYPLXIBDPZBBJGBWQTP4BVP5ANCNFSM4HJ5EIYQ .

CXX22 avatar Jun 24 '19 06:06 CXX22

i had the same issue and the below solution from stackoverflow worked for me. npm config set proxy null npm config set https-proxy null npm config set registry http://registry.npmjs.org/

from stackoverflow https://stackoverflow.com/questions/42371380/npm-err-error-connect-econnrefused

akbarali0203 avatar Aug 13 '19 11:08 akbarali0203

ping @VivaRunor - is this still outstanding?

gireeshpunathil avatar Oct 07 '19 06:10 gireeshpunathil

I need someone to help me with a softcopy of PYTHON GUI, A STEP BY STEP GUIDE TO DATABASE PROGRAMMING by Vivian, S.

On Mon, 7 Oct 2019, 07:28 Gireesh Punathil, [email protected] wrote:

ping @VivaRunor https://github.com/VivaRunor - is this still outstanding?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/nodejs/help/issues/1887?email_source=notifications&email_token=ALKBGF274N6H56ZWND3GMSTQNLJJPA5CNFSM4HJ5EIY2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEAPE6TQ#issuecomment-538857294, or mute the thread https://github.com/notifications/unsubscribe-auth/ALKBGF2HJYESD3MRQ4VBK7LQNLJJPANCNFSM4HJ5EIYQ .

CXX22 avatar Oct 07 '19 17:10 CXX22

I got the same issue while installing nodemailer I used the command npm install nodemailer please help me out

following is what pops up whenever I try to install

npm ERR! code ECONNREFUSED npm ERR! errno ECONNREFUSED npm ERR! FetchError: request to http://registry.npmjs.org/nodemailer failed, reason: connect ECONNREFUSED 127.0.0.1:3000npm ERR! at ClientRequest. (C:\Program Files\nodejs\node_modules\npm\node_modules\node-fetch-npm\src\index.js:68:14) npm ERR! at ClientRequest.emit (events.js:311:20) npm ERR! at Socket.socketErrorListener (_http_client.js:426:9) npm ERR! at Socket.emit (events.js:311:20) npm ERR! at emitErrorNT (internal/streams/destroy.js:92:8) npm ERR! at emitErrorAndCloseNT (internal/streams/destroy.js:60:3) npm ERR! at processTicksAndRejections (internal/process/task_queues.js:84:21) npm ERR! FetchError: request to http://registry.npmjs.org/nodemailer failed, reason: connect ECONNREFUSED 127.0.0.1:3000 npm ERR! at ClientRequest. (C:\Program Files\nodejs\node_modules\npm\node_modules\node-fetch-npm\src\index.js:68:14) npm ERR! at ClientRequest.emit (events.js:311:20) npm ERR! at Socket.socketErrorListener (_http_client.js:426:9) npm ERR! at Socket.emit (events.js:311:20) npm ERR! at emitErrorNT (internal/streams/destroy.js:92:8) npm ERR! at emitErrorAndCloseNT (internal/streams/destroy.js:60:3) npm ERR! at processTicksAndRejections (internal/process/task_queues.js:84:21) { npm ERR! message: 'request to http://registry.npmjs.org/nodemailer failed, reason: connect ECONNREFUSED 127.0.0.1:3000', npm ERR! type: 'system', npm ERR! errno: 'ECONNREFUSED', npm ERR! code: 'ECONNREFUSED', npm ERR! stack: 'FetchError: request to http://registry.npmjs.org/nodemailer failed, reason: connect ECONNREFUSED 127.0.0.1:3000\n' + npm ERR! ' at ClientRequest. (C:\Program Files\nodejs\node_modules\npm\node_modules\node-fetch-npm\src\index.js:68:14)\n' + npm ERR! ' at ClientRequest.emit (events.js:311:20)\n' + npm ERR! ' at Socket.socketErrorListener (_http_client.js:426:9)\n' + npm ERR! ' at Socket.emit (events.js:311:20)\n' + npm ERR! ' at emitErrorNT (internal/streams/destroy.js:92:8)\n' + npm ERR! ' at emitErrorAndCloseNT (internal/streams/destroy.js:60:3)\n' + npm ERR! ' at processTicksAndRejections (internal/process/task_queues.js:84:21)' npm ERR! } npm ERR! npm ERR! If you are behind a proxy, please make sure that the npm ERR! 'proxy' config is set properly. See: 'npm help config'

npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\abhi\AppData\Roaming\npm-cache_logs\2020-04-09T14_11_25_943Z-debug.log

Abhinav-vats avatar Apr 09 '20 14:04 Abhinav-vats

still an on going issue with every npm install package or npx package args commands :(

raedbenz avatar Jul 11 '20 06:07 raedbenz

try this command :

sudo npm install

we resolved this problem.

givingwu avatar Oct 16 '20 07:10 givingwu

try this command :

sudo npm install

we resolved this problem.

sudo installing of npm packages will just lead to more problems down the road.

The correct answer is to chown all of the folders that npm uses, not to use sudo. Or uninstall npm/node, delete all their folders, and reinstall.

Use of sudo with npm install is actually a security issue, because any random package that you happen to be including could be hacked, and if it detects it has sudo access, it can then do malicious stuff to your computer.

erikeckhardt avatar Nov 06 '20 17:11 erikeckhardt

The cause is likely :+1: 1 - your internet is down 2 - your dns is not resolving properly 3 - your regstry is not pointing to the right registry

As posted above, run the following: npm set registry https://registry.npmjs.org

This sets the registry to the main npm registry and if you fix point 1 and 2 it should work. And please do not post unrelated questions and mark this as resolved if it works, thanks.

VGerris avatar May 23 '21 09:05 VGerris

Hello, I don't have a proxy at all.

I have been "able" to do npm install. I'm using windows 11 pro now as of August 2021

This is what I'm getting:

$ npm install npm ERR! code ECONNREFUSED npm ERR! syscall connect npm ERR! errno ECONNREFUSED npm ERR! FetchError: request to http://localhost:4873/proxy-addr/-/proxy-addr-2.0.5.tgz failed, reason: connect ECONNREFUSED 127.0.0.1:4873 npm ERR! at ClientRequest.<anonymous> (C:\Users\Peter\AppData\Roaming\npm\node_modules\npm\node_modules\minipass-fetch\lib\index.js:97:14) npm ERR! at ClientRequest.emit (events.js:315:20) npm ERR! at Socket.socketErrorListener (_http_client.js:469:9) npm ERR! at Socket.emit (events.js:327:22) npm ERR! at emitErrorNT (internal/streams/destroy.js:106:8) npm ERR! at emitErrorCloseNT (internal/streams/destroy.js:74:3) npm ERR! at processTicksAndRejections (internal/process/task_queues.js:80:21) npm ERR! FetchError: request to http://localhost:4873/proxy-addr/-/proxy-addr-2.0.5.tgz failed, reason: connect ECONNREFUSED 127.0.0.1:4873 npm ERR! at ClientRequest.<anonymous> (C:\Users\Peter\AppData\Roaming\npm\node_modules\npm\node_modules\minipass-fetch\lib\index.js:97:14) npm ERR! at ClientRequest.emit (events.js:315:20) npm ERR! at Socket.socketErrorListener (_http_client.js:469:9) npm ERR! at Socket.emit (events.js:327:22) npm ERR! at emitErrorNT (internal/streams/destroy.js:106:8) npm ERR! at emitErrorCloseNT (internal/streams/destroy.js:74:3) npm ERR! at processTicksAndRejections (internal/process/task_queues.js:80:21) { npm ERR! code: 'ECONNREFUSED', npm ERR! errno: 'ECONNREFUSED', npm ERR! syscall: 'connect', npm ERR! address: '127.0.0.1', npm ERR! port: 4873, npm ERR! type: 'system' npm ERR! } npm ERR! npm ERR! If you are behind a proxy, please make sure that the npm ERR! 'proxy' config is set properly. See: 'npm help config'

I didn't have this problem before... but I had broadband with an ARRIS MODEM, now, I have just internet through the same company Wavebroadband but now, I'm using a different modem and router

Motorola MB8600 DOCSIS 3.1 Cable Modem, 6 Gbps Max Speed. Approved for Comcast Xfinity Gigabit, Cox Gigablast, and More, Black

And

TP-Link Deco Mesh WiFi System(Deco M3) –Up to 4,500 sq.ft Whole Home Coverage, Replaces WiFi Router/Extender, Plug-in Design, Works with Alexa, 3-Pack

So, I wonder if there's something I need to open on the modem to make NPM work?

pborregg avatar Nov 08 '21 03:11 pborregg