berry: [Bug]: yarn install hangs at Resolution Step
Self-service
- I’d be willing to implement a fix
Describe the bug
When running yarn install
or just yarn
, the installer seems to hang at one package during the Resolution Step, seemingly using 0 resources overall. This happens on version 3.2.0, when using both public and private sources (all of them are public, only one is private), hanging always on a public package, not always the same though, but it seems to cycle through them. Making the system wait
before installation seems to get it farther in, but it fixees nothing.
The packages install fine using npm.
To reproduce
Remove the lockfile and run yarn
with a lockfile that contains 1987 packages, one of them from a private repo requiring SSH authentication.
Environment
System:
OS: Linux 5.16 Parrot OS 5.0 (Electro Ara) 5.0 (Electro Ara)
CPU: (4) x64 Intel(R) Celeron(R) N4120 CPU @ 1.10GHz
Binaries:
Node: 16.14.2 - /tmp/xfs-16d9b8e0/node
Yarn: 3.2.0 - /tmp/xfs-16d9b8e0/yarn npm: 8.6.0 - ~/.nvm/versions/node/v16.14.2/bin/npm
Additional context
No response
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 1
- Comments: 17 (2 by maintainers)
after install yarn you need
yarn set version 1.22.1
is stable and it will solve your problem. (yarn version > 3 bug)package.json yarn.zip Copying these two files into a new folder and running
yarn upgrade-interactive
in it, and selecting the first package to upgrade does it for me. Some other combinations of packages to upgrade have the same effect. Yarn 4.0.1 via corepack, node 20.9.0I have this issue too, can take over 4 minutes
I am encountering the same issue with latest yarn and it reported “Completed in 2m 25s” but you do not really get any feedback that is doing anything. I was not able to spot a CPU spike either. I do suspect that it might be caused by some networking throttling on the server side (npm.org) but I have no proof as no logging happens. If one or two requirest need to timeout (likely 30s default) it might explain why it get “stuck”.
I’m seeing similar behavior while invoking
yarn install
inside a container. It doesn’t happen on my Linux or Mac OS host systems.Specifically, I see yarn hanging after the end of the resolution step.
I have isolated the issue; it is an endless-loop bug in
diff@4.0.1
which is used byyarn@3.2.0
. The bug also manifests in the latest version ofdiff@5.0.0
so it looks like Yarn is depending on a fundamentally buggy tool.I’ll file a new yarn issue to recommend that Yarn use some sort of timeout, or otherwise guard against runaway diff, or give us a way to opt out of diffing.
Looks like this is a manifestation of Node bug https://github.com/nodejs/node/issues/46060
This is still an issue with yarn 4.0.1 … even with nothing fancy configured:
What I do is run
yarn upgrade-interactive
, select a few dependencies, confirm and get stuck at:At this point it can’t even be killed by
ctrl+c
orctrl+d
and I have to sigkill that. This is on node nodev20.4.0