You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[BUG] npm install never finishes when a dependency has no matching version and two packages peer on it (11.21.1, 12.2.1) #10149
This is not just a request to bump a dependency for a CVE
This is not solely a request to bump a dependency for a CVE
Current Behavior
Since npm 11.21.1 and 12.2.1, npm install never finishes when a root dependency has no matching version and more than one installed package peers on it. It spins at full CPU instead of failing. npm 11.21.0 and 12.2.0 fail at once with ERESOLVE. The ETARGET that #9987 and #10118 (the fix for #9979) aim for is never reported.
With --loglevel silly the log repeats these three placements without end:
The versionless react@ is the node of the failed fetch of react@^999.0.0. It replaces the react@18.3.1 placed for react-shallow-renderer's peer, which then replaces it again, round after round. The new #loadFailures guard in #loadPeerSet lets both peer conflicts pass, react-dom's and react-test-renderer's. In 11.21.0 the first of them ends the install with ERESOLVE.
Expected Behavior
npm install fails with ETARGET ("No matching version found for react@^999.0.0"), as 11.21.1 already does when only react-dom peers on react.
The same steps on each release, with an empty cache and user config:
npm
result
11.21.0
ERESOLVE after 1 s
11.21.1
still running after 90 s, at full CPU
12.2.1
still running after 90 s, at full CPU
Without react-test-renderer (react-dom alone peering on react), 11.21.1 fails with ETARGET as intended.
#9891 also reports a hang where ETARGET is expected, but it predates 11.21.1 and needs --min-release-age. It may share part of this loop. I have not checked.
Activity
JavaScript: regenerate npm locks as npm 11.21.1 and 12.2.1 (#9304)