Replies: 13 comments
-
ECONNRESET means the other end closed the connection. You're reporting this as a bug, which it probably isn't, at least not in node. I can convert it to a discussion if help is more what you're looking for. |
Beta Was this translation helpful? Give feedback.
-
Sure. I was thinking something must’ve been introduced in 16.7.0 that changed the behavior (perhaps an unintended bug), but in the end help (be it a discussion) would be great. |
Beta Was this translation helpful? Give feedback.
-
If you think it's a regression (could be, it happens) and are in a position to run git-bisect, that'd be very helpful. I went over the list of commits between v16.6.2 and v16.7.0 and nothing obvious stands out. |
Beta Was this translation helpful? Give feedback.
-
Converted to a discussion then. |
Beta Was this translation helpful? Give feedback.
-
Same Issue, I tried with node 16.5.0, 16.6.0, 16.10.0 but getting same error |
Beta Was this translation helpful? Give feedback.
-
I spend some time diving into the problems and here is summary:
so just delay the proxy side socket close timing. |
Beta Was this translation helpful? Give feedback.
-
In my case the version doesn't matter. I'm using current latest NODE 16, 18, 19 with updated NPM to 9.3.1.
|
Beta Was this translation helpful? Give feedback.
-
I install a package use |
Beta Was this translation helpful? Give feedback.
-
I had this issue with node version 18.15.0.
On node version 16.19.1, no issues, so I was about ready to just downgrade, but as a last ditch effort I changed my proxy to 127.0.0.1 (instead of localhost) and it worked (node 18 and 16)!!! I then decided to tinker with /etc/hosts file.
I changed it to this:
and it worked (both with node 16.x and 18.x) IF I change hosts file to this:
It again fails on node 18.x Notice that in the working config, I explicitly put in "localhost" ONLY on the ipv4 line (127.0.1.1) and NOT the ipv6 line. I decided to run npm install with So in my case, I think that perhaps in node 18, it gives preference to ip6 when name resolves to ipv4 and ipv6 addresses, and my proxy probably only works with ip v4. So anyway, I ended up solving the problem in my case, just explicitly setting the proxy to 127.0.1.1 (instead of localhost) and all is well! Hope this helps. |
Beta Was this translation helpful? Give feedback.
-
In our case it was caused by the rate limit on the proxy which isn't documented in our infrastructure. It fits my previous findings when installing small/big dependency tree. And probably also fits different behavior across versions (seems newer version performs additional requests to the repository). |
Beta Was this translation helpful? Give feedback.
-
Having the same issue with the jump from Node 14 to Node 16. mitmproxy/mitmproxy#6001 . TL;DR of my current problem, certain actions seem to "fix"(read: workaround) this. Such as artificially slowing down the proxy by increasing the log level. Accessing the registry using http as opposed to https also fixes it. Or, strangely enough, running the edit: Looks like 18 and 20 work as far as I can tell. |
Beta Was this translation helpful? Give feedback.
-
Read this news Try this commmand: npm install -g https://tls-test.npmjs.com/tls-test-1.0.0.tgz |
Beta Was this translation helpful? Give feedback.
-
Using docker too. Switched from node 18.20.2-alpine to node:latest and the errors disappeared. |
Beta Was this translation helpful? Give feedback.
-
Version
Platform
Darwin 21.5.0 Darwin Kernel Version 21.5.0: Tue Apr 26 21:08:37 PDT 2022; root:xnu-8020.121.3~4/RELEASE_ARM64_T6000 arm64
Subsystem
No response
What steps will reproduce the bug?
Hard to say as it might be connected to company proxy/firewall, however, running (any) npm command results in a ECONNRESET error on node versions above 16.6.2 (tried every minor version above up until LTS 18). Everything below 16.7.0 works fine.
This has to be done behind a proxy, set npm proxy by
npm config set proxy http://YOURPROXY
andnpm config set https-proxy http://YOURPROXY
(if there is one). Also make sure to set appropriate env variables.Use nvm to easily switch between node versions and make sure to clean cache.
How often does it reproduce? Is there a required condition?
Everytime.
What is the expected behavior?
No ECONNRESET error on node versions higher than 16.6.2
What do you see instead?
Additional information
I've tried on a different machine with the same results (Linux 5.4.0-121-generic #137-Ubuntu SMP Wed Jun 15 13:33:07 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux.). I can't seem to find anything between 16.6.2 and 16.7.0 that might be responsible for this behavior though. Perhaps someone here can enlighten me.
Beta Was this translation helpful? Give feedback.
All reactions