Skip to content

Framework: Update Node.js to v24 (wp/6.0) - #86878

Draft
sirreal wants to merge 7 commits into
wp/6.0from
build/node-24-wp-6.0
Draft

sirreal wants to merge 7 commits into
wp/6.0from
build/node-24-wp-6.0

Conversation

@sirreal

@sirreal sirreal commented Nov 16, 2026 •

Copy link
Copy Markdown
Member

What?

Sets .nvmrc to Node.js 24.20 on wp/6.0, 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.0 branch moves to Node.js 24 in WordPress/wordpress-develop#15698. 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 37.0.3 and @es-joy/jsdoccomment 0.12.0, whose engines end at Node.js 17. 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.
  • build, dev and test-unit run wp-scripts with cross-env NODE_OPTIONS=--openssl-legacy-provider: @wordpress/dependency-extraction-webpack-plugin hashes with md4, which OpenSSL 3 disables. wp-scripts starts webpack in a new process, so the option goes in NODE_OPTIONS rather than on a node command.
  • 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.
  • bin/test-create-block.sh runs its wp-scripts build with cross-env NODE_OPTIONS=--openssl-legacy-provider too. The script calls wp-scripts directly, so the build script's setting does not reach it, and the Create Block check failed on md4.
  • .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. No installed version changes. 19 entries that no package requires are dropped, such as enzyme's nested react-is, semver and dom-serializer, nested copies under @storybook/*, and archiver's nested buffer 5.6.0.

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.0, 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 37.0.3 and @es-joy/jsdoccomment 0.12.0, whose engines end at Node.js 17.
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. No installed version changes.
The dependency extraction webpack plugin hashes with md4, which OpenSSL 3 in Node.js 17 and later disables. Set --openssl-legacy-provider for the build, dev and test-unit scripts.
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

bin/test-create-block.sh runs wp-scripts build directly, so the build script's setting does not apply. Without it, webpack fails on md4 under OpenSSL 3.
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