Repository navigation
Require Node 20 and move to Vitest 4.1.11 - #13
Merged
Merged
Conversation
Vitest below 4.1.11 is affected by GHSA-82fw-gwwq-j7x9 and has no patched 3.x release. Vitest 4 supports Node 20 or later, so the engines floor rises from 18 (end of life) to 20 and CI drops its Node 18 leg.
npm 10, which Node 20 and 22 bundle, crashes building the ideal tree for Vitest 4's optional peer set (npm/cli#9787). npm 11 resolves it.
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.
Fixes Dependabot alert GHSA-82fw-gwwq-j7x9 (Vitest, development scope). The patched release is 4.1.11, and no 3.x release is patched. Vitest 4 supports Node
^20 || ^22 || >=24, so Node 18 goes.Changes
vitestand@vitest/coverage-v8:^3.2.6to^4.1.11. Coverage-v8 4.1.11 peers on exactly vitest 4.1.11.engines.node:>=18to>=20. Node 18 reached end of life in April 2025.[18, 20, 22, 24]to[20, 22, 24].docs/installation.mdnow state that the Node entry points and the CLI need Node.js 20 or later.Verification (local, Node 22)
npm run lint,npm run typecheck,npm test(147 passed, 5 files) andnpm run buildall pass. The build output is unchanged.CI installs with npm 11
The first run failed at
npm installon Node 22, in both the test job and the visual job, withCannot read properties of null (reading 'edgesOut'). This is npm/cli#9787: npm 10.9, which ships with Node 20 and 22, crashes in#loadPeerSetwhile resolving Vitest 4's optional peer set. A fresh install with no lockfile is enough to trigger it, and npm 11 resolves the same manifest.Both jobs now run
npm install -g npm@11before installing. The alternative waslegacy-peer-deps=truein.npmrc, which would skip peer resolution for everyone, so it was not used.Contributors on Node 20 or 22 with npm 10.9 will hit the same crash locally. npm 10.8.2 resolved this manifest cleanly in a local test.