GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix: pin vitest to 5.0.1 and override it to fix npm 10 install crash by Puppo · Pull Request #533 · fastify/fastify-autoload

Conversation

@Puppo

@Puppo Puppo commented Oct 5, 2026 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Member

Motivation

A fresh npm i on main currently fails on Node 22 (npm 10):

npm error Cannot read properties of null (reading 'edgesOut')

Root cause

  • vite@8, a peer of vitest, has an optional peer @vitejs/devtools. That package requires @vitejs/devtools-vitest, which declares a peer of vitest: "*".
  • npm 10's arborist resolves that vitest@* on its own. Now that vitest 5 is latest, it picks [email protected], which pulls @vitest/[email protected], which in turn requires [email protected]. That clashes with the root [email protected].
  • Instead of reporting a peer conflict, npm 10 crashes in #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 latest on 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 there vitest@* resolves to 4.1.11. With vitest 5 at the root, that is the same conflict in reverse, and npm 10 crashes the same way.

Fix

  • Pin vitest to 5.0.1.
  • Add "overrides": { "vitest": "5.0.1" } so every vitest in the tree, including the one requested through the optional peer chain, resolves to the same version. This removes the conflict on every Node version.
  • The version is exact rather than a range so npm 10 and npm 11 install the same thing. npm 11 honours min-release-age=7 from .npmrc and npm 10 ignores it, so a ^5 range would give different versions depending on the npm version.

Note

The override has to match the vitest devDependency exactly 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, borp and tstyche already declare Node >= 22 in their engines.

Verification

Clean npm i --ignore-scripts + npm test on macOS:

Node npm vitest installed Install Tests
20.20.2 10.8.2 5.0.1 ok (EBADENGINE warnings) pass
22.23.3 10.9.9 5.0.1 ok pass
24.21.0 11.19.0 5.0.1 ok pass
26.5.1 11.17.0 5.0.1 ok pass

Without the override, Node 20 still crashes with the edgesOut error; 22, 24 and 26 install fine.

Supersedes #531.

Checklist

  • run npm run test
  • commit message and code follows the Developer's Certification of Origin and the Code of conduct

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Puppo added 2 commits October 5, 2026 17:18
@Puppo
fix: update vitest to version 5.0.3
30c5868
@Puppo
fix: override vitest to v5 to fix npm 10 install crash
9f2ffbe
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.
@Puppo Puppo mentioned this pull request Oct 5, 2026
ci: enable trusted publishing releases #532
Merged
4 tasks
ilteoood
ilteoood approved these changes Oct 5, 2026
View reviewed changes
Eomm
Eomm reviewed Oct 6, 2026
View reviewed changes
Comment thread package.json Resolved

Uh oh!

There was an error while loading. Please reload this page.

@Puppo
fix: pin vitest version to 5.0.1 for consistency
ae410ad
@Puppo
Puppo requested a review from Eomm October 6, 2026 13:26
@Puppo Puppo changed the title fix: bump vitest to v5 and override it to fix npm 10 install crash fix: pin vitest to 5.0.1 and override it to fix npm 10 install crash Oct 6, 2026
Eomm
Eomm approved these changes Oct 6, 2026
View reviewed changes
Tony133
Tony133 approved these changes Oct 7, 2026
View reviewed changes
@Tony133
Tony133 merged commit eac381a into fastify:main Oct 7, 2026
19 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@Puppo
Puppo deleted the fix/vitest-5-npm10 branch October 7, 2026 10:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@ilteoood ilteoood ilteoood approved these changes
@Eomm Eomm Eomm approved these changes
@Tony133 Tony133 Tony133 approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

4 participants

@Puppo @ilteoood @Eomm @Tony133
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.