-
Notifications
You must be signed in to change notification settings - Fork 95
Description
Problem
The root package-lock.json currently resolves @types/node@25.2.0 at the hoisted root level, despite every workspace declaring @types/node@^22.x or @types/node@^20.x. No workspace declares ^25.
This was introduced in commit 36a3be37 ("chore: recreate package-lock files from linux"), where npm install was run on a machine with Node 25 installed. Transitive dependencies with loose constraints (>=18, *) allowed npm to hoist @types/node@25 to the root node_modules/.
Impact
-
PR #2110 is failing because the lockfile was generated with Node 25, causing native bindings (
@tailwindcss/oxide,@swc/core) to resolve for Node 25's ABI. CI runs Node 22, so the native bindings are incompatible. -
PR #2122 (Renovate security update) appears to "downgrade"
@types/nodefrom25.2.0→22.19.9as a side-effect ofnpmDedupeinrenovate.json. This is actually correct deduplication, but it produces a noisy diff and masks the real problem. -
Type safety risk:
@types/node@25includes APIs that don't exist in Node 22. TypeScript won't catch usage of Node 25-only APIs when the types are wrong for the target runtime.
Root cause
There is no enforcement preventing developers from generating lockfiles with a different Node version than CI uses (Node 22). The engines field exists ("node": "^22.14.0 || >=24.10.0") but is not enforced by npm by default.
Proposed fix
- Add
.nvmrcpinning to Node 22, so developers usingnvmauto-switch to the correct version - Add
.npmrcwithengine-strict=truesonpm installrefuses to run on unsupported Node versions - Add
@types/nodeoverride in rootpackage.json("@types/node": "^22.0.0") to prevent transitive deps from pulling in a different major version - Add Renovate
allowedVersionsconstraint for@types/node(<23.0.0) to prevent automated major bumps - Run
npm dedupeon main to sync the lockfile baseline and fix the current v25 pollution