Require Node 24 and npm 11 - #58
Open
hupponen wants to merge 1 commit into
Open
Conversation
Older npm versions install optional peer dependencies that npm 11 leaves out, so they produce a package-lock.json that npm ci rejects on the other version. The dev container and the production images use Node 24, which comes with npm 11. engine-strict in .npmrc turns the version check into an error, because a warning is easy to miss and the lockfile error it leads to is confusing. .nvmrc lets nvm and similar tools select the right version in the first place, so that check does not have to be the thing that fails.
hupponen
force-pushed
the
require-node-24
branch
from
August 28, 2026 21:37
42703b6 to
4b19fd4
Compare
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.
npm versions resolve optional peer dependencies differently, which makes
package-lock.jsondepend on the npm version that wrote it.A concrete case: vite 8.2.2 has
esbuildas an optional peer dependency. npm 11 leaves optional peers out of the lockfile, npm 10 installs them. A lockfile written by npm 11 therefore makesnpm cifail on npm 10 withMissing: esbuild@0.28.2 from lock fileand 26 similar lines for its platform packages. Regenerating with npm 10 fixes that machine, but then the nextnpm installon npm 11 removes those 512 lines again, so the lockfile keeps flipping back and forth. This has happened before, see 86f04bb "Regenerate package-lock.json with npm 11.14.0".The dev container and the production images use Node 24, which comes with npm 11, so declare that as the requirement instead of leaving it to whatever each developer happens to have installed.
Changes
enginesinpackage.json: node >= 24, npm >= 11.npmrcwithengine-strict=true, because npm only warns by default and the resulting lockfile error is confusing to debugTesting
npm cion Node 24.20.0 with npm 11.19.0: installs normallyengines.nodetemporarily set to>=99,npm cifails as intended:npm run build: production bundle buildsAnyone on an older Node now gets a clear error instead of a lockfile mismatch. Switching Node versions is easiest with nvm or asdf.