pnpm: pnpm install fails when npm install succeeds
pnpm version:
➜ pnpm --version
8.3.0
➜ npm --version
9.5.0
➜ node --version
v18.15.0
Code to reproduce the issue:
This is a fresh install. I was using nodejs and npm and everything was working fine. A coworker suggested that we should use pnpm
so I downloaded and tried to use it. From everything I read, it seemed like it would be a drop in replacement but theres something odd going on here. I tried installing from the standalone posix binary as well as using homebrew and both yield the same issue. npm install
works fine, but pnpm install
does not. No VPN. No proxy. Nothing that should get in the way. Can also curl the registry just fine. When I try running pnpm install
this is the error that I get:
WARN GET https://registry.npmjs.org/@babel%2Fcore error (ERR_SOCKET_TIMEOUT). Will retry in 10 seconds. 2 retries left.
WARN GET https://registry.npmjs.org/@babel%2Fpreset-env error (ERR_SOCKET_TIMEOUT). Will retry in 10 seconds. 2 retries left.
WARN GET https://registry.npmjs.org/@babel%2Fpreset-typescript error (ERR_SOCKET_TIMEOUT). Will retry in 10 seconds. 2 retries left.
WARN GET https://registry.npmjs.org/@cloudflare%2Fworkers-types error (ERR_SOCKET_TIMEOUT). Will retry in 10 seconds. 2 retries left.
WARN GET https://registry.npmjs.org/babel-jest error (ERR_SOCKET_TIMEOUT). Will retry in 10 seconds. 2 retries left.
WARN GET https://registry.npmjs.org/@types%2Fjest error (ERR_SOCKET_TIMEOUT). Will retry in 10 seconds. 2 retries left.
WARN GET https://registry.npmjs.org/jest error (ERR_SOCKET_TIMEOUT). Will retry in 10 seconds. 2 retries left.
WARN GET https://registry.npmjs.org/jest-environment-miniflare error (ERR_SOCKET_TIMEOUT). Will retry in 10 seconds. 2 retries left.
WARN GET https://registry.npmjs.org/miniflare error (ERR_SOCKET_TIMEOUT). Will retry in 10 seconds. 2 retries left.
WARN GET https://registry.npmjs.org/ts-node error (ERR_SOCKET_TIMEOUT). Will retry in 10 seconds. 2 retries left.
WARN GET https://registry.npmjs.org/wrangler error (ERR_SOCKET_TIMEOUT). Will retry in 10 seconds. 2 retries left.
Saw another issue similar to this, but theres were closed due to a different issue. Googling for help is useless (really wish this project had a different name).
Expected behavior:
pnpm install
would work out of box just like npm install
Actual behavior:
It doesn’t
Additional information:
NPM and Node versions above. On OSX M2 chip.
About this issue
- Original URL
- State: open
- Created a year ago
- Reactions: 21
- Comments: 51 (3 by maintainers)
Disable Ipv6 works fine
facing the same issue on mac, tried reinstalling pnpm using brew and link it, its started working for me.
confirmed this happens in ubuntu too, disabling ipv6 reduces install time from 10m to < 3s:
On linux, simply change the DNS:
And then add this line
Disable the Ipv6 was the solution. Thanks
Had this
GET https://registry.npmjs.org/create-vite error (ERR_SOCKET_TIMEOUT). Will retry in 10 seconds. 2 retries left.
issue when trying to install Vite with the commandpnpm create vite
.I use pnpm version
8.14.1
.I was using WARP VPN by Cloudflare, and after turning off the VPN, the installation went through!
I have this problem either on my Windows 11 computer.
And following actions will be a bit useful:
The problem now seems to appear only on
pnpm 8.3.x
Disabled IPv6 on my LAN network connection and the error went away immediately, same as for @alinpr18 .
Disable IPv6 in Adapter Settings (Windows 11)
Overall, while IPv6 offers benefits such as a larger address space and improved routing efficiency, in some cases, disabling it can resolve connectivity issues, especially if there are configuration or compatibility issues with your network environment. However, it’s worth noting that IPv6 is the future of internet protocol, and disabling it should be considered a temporary workaround rather than a permanent solution. If possible, it’s recommended to investigate and address the underlying issues to ensure full IPv6 compatibility and future-proof your network infrastructure.
In my case I Disable and Enable IPv6 and its work perfectly
I wonder if others can also reproduce this workaround? For @mjpitz the issue was present when installing from
curl | sh
orbrew
. But not when usingnpm install -g pnpm
, without changing anything IPv6/networking related.Could it be it’s both IPv6 related, and specific to the
@pnpm/exe
style standalone installation?When I try to resolve the IPv6 address of registry.npmjs.org like this:
it seems pnpm is really trying to use the resolved IPv6 address here. It does not fall back to a IPv4 address.
If i try to browse the resolved IPV6 address directly, like:
https://[2606:4700::6810:1b23]/eslint-plugin-prettier
my browser does not get a response.
It seems the problem is the npm registry itself and the DNS entry for IPv6. npm and yarn seem to do a slightly different kind of name resolution ultimately resolving to a IPv4 address so they succeed.
That is likely the reason why it works for @alinpr18 to disable IPV6
I have the same issue, I solved it by doing the following:
i had this issue on windows 11 suddenly when i was trying
pnpm outdated
. it didn’t give errors yesterday & i probably updated windows 11 few days ago, not yesterday so idk how it appeared randomly.oh, i think cloudflare warp gave that error because i updated it in the morning.
i followed this guide: https://www.windowscentral.com/software-apps/windows-11/how-to-disable-tcpipv6-ipv6-on-windows-11
but last 2 steps, i had to expand
Local Area Connection
and others & click onEdit
besidesMore adapter options
but that didn’t solve the error.disabling cloudflare warp solved it.
Same issue with
pnpm 8.14.1
/node 18 on a Starlink/TPLink Deco XE75 (Wifi 6E) network on a Mac. Disabling IPV6 (setting the network to “Link-local only”) solved it temporarily.I got this issue a couple days ago and both of these worked for me (MacOS 13 Ventura):
Thanks!
Ran into the same problem trying to install vitest with pnpm, and disabling IPv6 indeed helped.
However I really hope this workaround wouldn’t remain a permanent requirment. I see it as a significant reason to hold back from using pnpm in projects, despite it’s advantages.
For covenience of future visitors of this thread, here’s a link to a random guide from a Google search about how to disable IPv6 on Windows: https://bigbluebutton.org/how-to-disable-ipv6/