Skip to content

Framework: Update Node.js to v24 (wp/6.2) - #86880

Draft
sirreal wants to merge 5 commits into
wp/6.2from
build/node-24-wp-6.2
Draft

sirreal wants to merge 5 commits into
wp/6.2from
build/node-24-wp-6.2

Conversation

@sirreal

@sirreal sirreal commented Nov 16, 2026 •

Copy link
Copy Markdown
Member

What?

Sets .nvmrc to Node.js 24.20 on wp/6.2, as on trunk, and makes the branch install, build, lint and run its unit tests with Node.js 24 and npm 11.

Why?

The wordpress-develop 6.2 branch moves to Node.js 24 in WordPress/wordpress-develop#15705. This branch's CI takes Node.js from .nvmrc. npm 11 rejects the branch's engines, and npm install rewrites its version 1 lockfile, which fails the Static Analysis check.

How?

  • .nvmrc is 24.20.
  • engines.npm drops its <7 bound, which rejects npm 11, and .npmrc drops engine-strict = true: with it, npm 11 refuses eslint-plugin-jsdoc 39.6.9 and @es-joy/jsdoccomment 0.36.1, whose engines end at Node.js 19. npm now only warns about those two.
  • .npmrc sets legacy-peer-deps = true, which keeps npm 6's peer dependency handling. Without it npm 11 adds missing peer dependencies to the lockfile.
  • bin/validate-package-lock.js reads the lockfile's packages section instead of dependencies, which lockfile version 3 does not have, as minimal node and npm upgrade #53426 did on trunk.
  • .github/workflows/end2end-test.yml runs npx wp-scripts test-e2e instead of $( npm bin )/wp-scripts test-e2e: npm 9 removed npm bin, so the Puppeteer end-to-end jobs failed before running a test. Trunk made the same change in minimal node and npm upgrade #53426.
  • Regenerates package-lock.json with npm 11 (npm install --package-lock-only, then npm ci and npm install, until the file no longer changes), which converts it from lockfile version 1 to 3. The only installed version change is inside appium, which runs the native end-to-end tests: npm 11 installs the versions in appium's own npm-shrinkwrap.json, which npm 6 did not apply here, so qs moves from 6.5.3 to 6.5.2 under appium's request. 8 entries that no package requires are dropped, such as two react-refresh 0.4.3 copies and terser-webpack-plugin's nested source-map-support 0.5.19.

Testing Instructions

With Node.js 24 and npm 11: npm ci && npm run build && npm run lint && npm run test:unit.

The build output is byte-identical to a Node.js 14 build of wp/6.2, and the unit test results are the same.

Use of AI Tools

AI assistance: Yes
Tools: Claude Code
Model: Claude Opus 5.5
Used for: Applying the changes, regenerating the lockfile, building and testing on Node.js 14 and 24 and comparing the output, and drafting this description.

npm 11 rejects the `npm <7` bound. With engine-strict, it also rejects eslint-plugin-jsdoc 39.6.9 and @es-joy/jsdoccomment 0.36.1, whose engines end at Node.js 19.
npm 11 rewrites the lockfile version 1 file on install, which fails the check for local changes. legacy-peer-deps keeps npm 6's peer dependency handling, so no peer dependency is added. Versions are unchanged apart from qs under appium's request, which npm 11 installs from appium's npm-shrinkwrap.json: 6.5.3 to 6.5.2.
Lockfile version 3 has no top-level dependencies object, so the script threw. Trunk made the same change in #53426.
@sirreal sirreal added the [Type] Build Tooling Issues or PRs related to build tooling label Nov 16, 2026
@coderabbitai

coderabbitai Bot commented Nov 16, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

npm 9 removed `npm bin`, so `$( npm bin )/wp-scripts` fails before any test runs. Trunk made the same change in #53426.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Type] Build Tooling Issues or PRs related to build tooling

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant