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 4 years ago
- Reactions: 48
- Comments: 89 (5 by maintainers)
Disable Ipv6 works fine
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
facing the same issue on mac, tried reinstalling pnpm using brew and link it, its started working for me.
Disable the Ipv6 was the solution. Thanks
Disabled IPv6 on my LAN network connection and the error went away immediately, same as for @alinpr18 .
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 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.xI had the same problem using ubuntu 22.04. To me works the following settings
net.ipv6.conf.all.disable_ipv6 = 1net.ipv6.conf.default.disable_ipv6 = 1net.ipv6.conf.lo.disable_ipv6 = 1sudo sysctl -psudo systemctl restart systemd-resolvednpm config delete proxynpm config delete https-proxynpm config delete registrynpx npm@latest install -g --verboseRan 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/
This hint solved the issue for me. I had installed pnpm using wget and was getting
I deleted the following directory.
and installed it using npm as follows
and everything worked fine.
Disable IPv6 in Adapter Settings (Windows 11)
I had pnpm 8.15.4 installed on my machine. The repo I was working on had the following specified in package.json
“packageManager”: “pnpm@7.5.0”
After made the following changes and ran pnpm install this issue got fixed.
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 got this issue a couple days ago and both of these worked for me (MacOS 13 Ventura):
Thanks!
I wonder if others can also reproduce this workaround? For @mjpitz the issue was present when installing from
curl | shorbrew. 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/exestyle standalone installation?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
After reducing the node version from 20.19.2 to 18.20.8, It works.
How do i disable it in vercel ?? because my vercel build gives the same error whereas it works perfectly fine on my local machine
I turn off Cloudflare WARP and pnpm work for me!
I had this issue when using a proxy on my pc. fixed by adding https://pnpm.io/npmrc#proxy like
proxy=http(s)://192.X.X.X:PORTto .npmrcThis still happens.
@neelabalan thanks, using IPv6 works
Works like a charm!
I have the same issue, I solved it by doing the following:
Thanks a lot. This worked for me on Ubuntu 23.10.
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 Connectionand others & click onEditbesidesMore adapter optionsbut 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.+1 for disabling ipv6, thanks.
Maybe, in addition, you could configure your DNS, it worked for me 😃
I have the same problem (under Windows 11).
When I click on one of the links in the console, the browser opens immediately with the json from the package registry, so its not a network issue.
For reference I couldn’t reproduce on Linux.
Both
node v18.15.0+pnpm v8.3.0and the latestnode v18.16.0+pnpm v8.3.1work normally for me. Even when removing./node_modules,~/.cache/pnpmor~/.local/share/pnpm/store/v3/files/.