pnpm
pnpm copied to clipboard
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.
For reference I couldn't reproduce on Linux.
Both node v18.15.0
+ pnpm v8.3.0
and the latest node v18.16.0
+ pnpm v8.3.1
work normally for me.
Even when removing ./node_modules
, ~/.cache/pnpm
or ~/.local/share/pnpm/store/v3/files/
.
This is still happening with 8.3.1
If there are no additional network configurations then I don't know why it would fail. Does it also fail on your colleague's machine? Does Yarn work?
I don't have yarn installed nor was it declared as a required co-dependency.
So here's an interesting bit. When I installed the command through npm
, it worked fine.
I'm having the same problem, when I use yarn or npm they work normally
node 18.16.0 and pnpm 8.3.1
Disable Ipv6 works fine
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.
Interesistengly, above command would log:
WARN GET https://registry.npmjs.org/@typescript-eslint%2Feslint-plugin error (ETIMEDOUT). Will retry in 10 seconds. 2 retries left.
WARN GET https://registry.npmjs.org/eslint error (ETIMEDOUT). Will retry in 10 seconds. 2 retries left.
WARN GET https://registry.npmjs.org/eslint-plugin-prettier error (ETIMEDOUT). Will retry in 10 seconds. 2 retries left.
WARN GET https://registry.npmjs.org/electron-updater error (ETIMEDOUT). Will retry in 10 seconds. 2 retries left.
WARN GET https://registry.npmjs.org/eslint-plugin-react error (ETIMEDOUT). Will retry in 10 seconds. 2 retries left.
and so on ....
then
ERR_PNPM_META_FETCH_FAIL GET https://registry.npmjs.org/eslint-plugin-prettier: request to https://registry.npmjs.org/eslint-plugin-prettier failed, reason: connect ETIMEDOUT 2606:4700::6810:1823:443
ERR_PNPM_META_FETCH_FAIL GET https://registry.npmjs.org/eslint-plugin-import: request to https://registry.npmjs.org/eslint-plugin-import failed, reason: connect ETIMEDOUT 2606:4700::6810:1823:443
ERR_PNPM_META_FETCH_FAIL GET https://registry.npmjs.org/husky: request to https://registry.npmjs.org/husky failed, reason: connect ETIMEDOUT 2606:4700::6810:1823:443
ERR_PNPM_META_FETCH_FAIL GET https://registry.npmjs.org/eslint-plugin-react: request to https://registry.npmjs.org/eslint-plugin-react failed, reason: connect ETIMEDOUT 2606:4700::6810:1823:443
In the end pnpm up will provide a list of package updates:

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
Disabled IPv6 on my LAN network connection and the error went away immediately, same as for @alinpr18 .
Disabled IPv6 on my LAN network connection and the error went away immediately, same as for @alinpr18 .
it might even work, but I don't think it's a valid resolution
So here's an interesting bit. When I installed the command through
npm
, it worked fine.
I wonder if others can also reproduce this workaround?
For @mjpitz the issue was present when installing from curl | sh
or brew
.
But not when using npm 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?
I have this problem either on my Windows 11 computer.
And following actions will be a bit useful:
- Disable IPV6/network LAN
- Try setup a proxy
- Change the registry
The problem now seems to appear only on pnpm 8.3.x
Thank you @TalexDreamSoul. I resolved mine. I had installed pnpm
with npm
and it remained stuck at 8.3.0.
This was in my /User
library. I removed it and the one installed through brew
started working. I updated that version to 8.5.1
.
Also having this problem, forcing me to use a VPN to be able to download anything using pnpm. Sadly, my internet provider only hands out ipv6 addresses..
Using yarn or npm works because they seem to use a different way to resolve packages.
Mac M2 chip + pnpm v8.6
I might have a slightly related issue:
- I get the same warnings / timeouts when updating Node packages via topgrade (which uses
pnpm
) -
pnpm
on the command line works fine
When I disable IPv6 (on my Mac) the timeouts (in topgrade
) are gone...
In version 8.6.3
| windows; happened too, and once I disabled IPv6 in my network settings it started to work normally, I was able to use any command that involved a request
confirmed this happens in ubuntu too, disabling ipv6 reduces install time from 10m to < 3s:
sudo sysctl -w net.ipv6.conf.all.disable_ipv6=1
sudo sysctl -w net.ipv6.conf.default.disable_ipv6=1
sudo sysctl -w net.ipv6.conf.lo.disable_ipv6=1
Disable Ipv6 works fine
Disable the Ipv6 was the solution. Thanks
Disable Ipv6 works fine
I was trying with other package managers, and in fact, I disabled IPv6, and it was fixed for npm, yarn, and pnpm. <3
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/
Still have this issue even after disabling IPV6 on Macbook Pro M1.
Still have this issue even after disabling IPV6 on Macbook Pro M1.
Maybe, in addition, you could configure your DNS, it worked for me :)
Still have this issue even after disabling IPV6 on Macbook Pro M1.
Maybe, in addition, you could configure your DNS, it worked for me :)
Thanks! It helped, but what ultimately worked was also connecting through a VPN. I think my local ISP has some issues with NPM for some reason.
it worked for me thanks
+1 for disabling ipv6, thanks.
I had the same problem. I just disabled IPV6 and also added the Cloudflare DNS servers (just in case). Now everything works fine.
I am facing this problem but neither disabling IPV6 nor adding DNS servers do not work.