Conversation
npm 10 (bundled with Node 20 and 22) crashes with "Cannot read properties of null (reading 'edgesOut')" when vite's optional peer chain (@vitejs/devtools -> @vitejs/devtools-vitest -> vitest@*) resolves to a different vitest major than the root one. Overriding vitest keeps a single version in the tree. Use ^5.0.1 so npm 11 installs respect min-release-age=7.
4 tasks
ilteoood
approved these changes
Oct 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
A fresh
npm ionmaincurrently fails on Node 22 (npm 10):Root cause
vite@8, a peer ofvitest, has an optional peer@vitejs/devtools. That package requires@vitejs/devtools-vitest, which declares a peer ofvitest: "*".vitest@*on its own. Now that vitest 5 islatest, it picksvitest@5.x, which pulls@vitest/browser-playwright@5.x, which in turn requiresvitest@5.x. That clashes with the rootvitest@4.1.11.#loadPeerSet(build-ideal-tree.js). npm 11 (Node 24/26) handles the same tree correctly.Nothing in this repo changed. It started when vitest 5 became
lateston the registry.Why bumping vitest alone (#531) is not enough
On Node 20, npm prefers engine-compatible versions. vitest 5 requires Node
^22.12.0 || ^24.0.0 || >=26.0.0, so therevitest@*resolves to4.1.11. With vitest 5 at the root, that is the same conflict in reverse, and npm 10 crashes the same way.Fix
vitestto^5.0.1."overrides": { "vitest": "^5.0.1" }so everyvitestin the tree, including the one requested through the optional peer chain, resolves to the same major. This removes the conflict on every Node version.^5.0.1rather than^5.0.3because.npmrcsetsmin-release-age=7. npm 11 honours it and would refuse5.0.3(published 2026-09-30) until 2026-10-07. With^5.0.1, npm 11 installs5.0.2for now and moves to5.0.3after that date; npm 10 ignores the setting and installs5.0.3.Note
The override has to be kept in sync with the
vitestdevDependency on future bumps; otherwise npm rejects the install with an override conflict. It can be removed once Node 20 is dropped from the CI matrix. vitest 5,borpandtstychealready declare Node >= 22 in their engines.Verification
Clean
npm i --ignore-scripts+npm teston macOS:Without the override, Node 20 still crashes with the
edgesOuterror; 22, 24 and 26 install fine.Supersedes #531.
Checklist
npm run test