Make WordPress Core

Opened 5 months ago

Closed 8 days ago

Last modified 10 hours ago

#65451 closed task (blessed) (fixed)

Update Node.js to 24.x

Reported by: desrosj Owned by: desrosj
Priority: normal Milestone: 7.2
Component: Build/Test Tools Version:
Severity: normal Keywords: has-patch
Cc: Focuses:

Description

This is a tracking ticket for the work required to upgrade Core to using Node.js 24.x, which is the version with Active LTS status at the time of creating this ticket.

For reference, the Core Handbook has a ​page documenting the related considerations and changes required when updating Node.js for WordPress and includes a checklist to follow.

Some key dates:

  • 20.x reached end-of-life on April 30, 2026.
  • 22.x reaches EOL on April 30, 2027
  • 24.x transitions to maintenance LTS on April 30, 2027.
  • 26.x is Current and transitions to Active LTS in October 2026.
  • Starting with version 27, the Node.js project is transitioning from an even/odd versioning practice (even releases only reach LTS status, odd releases are not meant for production use and supported only for 6 months) to an annual one (every release reaches LTS status after a 6 month Current phase).

Previously:

  • #59663 - Node.js 20.x (18.x was skipped)
  • #56658 - Node.js 16.x (#59187 for bundled themes)
  • #52341 - Node.js 14.x (all older branches receiving security updates)
  • #45241 - Node.js 10.x

Change History (51)

#1 @desrosj
5 months ago

Related #65432.

This ticket was mentioned in ​PR #11776 on ​WordPress/wordpress-develop by ​@desrosj.


5 months ago
#2

  • Keywords has-patch added

This makes the necessary changes to update the versions of Node.js and npm used by WordPress Core.

Trac ticket: Core-65451.

AI assistance: None

​@desrosj commented on ​PR #11776:


5 months ago
#3

This PR resolve Core-65432.

I don't know that this resolves Core-65432. This PR is specifically targeting Core itself and does not make any changes to the respective GitHub Actions workflow files. While the changes required to make sure actions continue to run within the GHA environment are related, they do not necessarily impact each other (the actions/setup-node action installs and configures any version of Node.js the project is using).

Also, do you have plans to wrap this up soon?

I have created Core-65451 to track this effort in Trac/wordpress-develop SVN. There has also been a significant amount of legwork around this already in ​https://github.com/WordPress/gutenberg/issues/72973.

As far as the current status. Upgrading Node.js is currently blocked on the ​Systems Team side.

#4 @desrosj
5 months ago

  • Keywords has-patch removed

To link related discussions, there has been significant effort on the Gutenberg side of things in ​Gutneberg-72973, which included the creation of the ​new handbook page mentioned in this ticket's description.

There is also a ​project board in GitHub.

#5 @desrosj
5 months ago

This is also blocked by #63013.

#6 @wildworks
4 months ago

  • Milestone 7.1 → 7.2

This is also blocked by #63013.

Since ticket #63013 has been punt, let's punt this ticket as well. It seems unlikely that we will have enough time to address both in the 7.1 release.

​@manzoorwani.jk commented on ​PR #11776:


3 months ago
#7

Let us refresh this PR to prepare for the merge.

#9 @desrosj
3 months ago

I took a look at this today and updated the PR. Here is a list of what's needed:

  • #63013 is a blocker as it prevents Twenty Nineteen from using 24.x.
  • #66004 is a blocker as it prevents Twenty Twenty from using 24.x.
  • The corresponding Gutenberg PR looks good.

Please see the ​Gutenberg PR and ​issue for the full coordination effort.

This ticket was mentioned in ​Slack in #core-editor by aduth. ​View the logs.


3 months ago

​@aduth commented on ​PR #11776:


3 months ago
#11

As ​discussed in Slack, in order for this to be ready to commit, it will need one or the other of:

  • Addressing blockers within theme packages (replacing incompatible sass and stylelint-a11y dependencies)
  • Or, reverting the changes that update impacted themes to Node v24 and keep them at Node v20 until we can address those blockers separately

#12 @desrosj
2 months ago

Related: #66040.

#13 @desrosj
2 months ago

  • Keywords fixed-major added

I missed the Fixes: annotation in the commit message, but r63539 applies this upgrade.

Leaving this open while we consider upgrading other branches that currently run 20.x.

This ticket was mentioned in ​PR #13380 on ​WordPress/wordpress-develop by ​@manzoorwani.jk.


2 months ago
#14

  • Keywords has-patch added

Twenty Nineteen is the last default theme still using node-sass, deprecated since 2020. It ships no prebuilt binary for Node.js 22 or later, and its nan-based addon no longer compiles against current V8, so npm install fails on newer runtimes. This blocks #11776, where ​the build job errors.

This switches to sass and commits the regenerated stylesheets. The build also moves from run-p to run-s, as in Twenty Twenty-One: under run-p, build:rtl races build:style and can regenerate style-rtl.css from a stale style.css.

Non-latin fallbacks

Dart Sass drops contextual @extend selectors it considers redundant, ignoring the specificity they relied on. That cost eight selectors their non-latin font across 31 locales. %non-latin-fonts moves into its own partial imported last, so the fallbacks win on source order instead.

Verification

8907 probes across four fixtures (LTR, RTL, editor, print) in headless Chrome, hashing every computed property and pseudo-element against the node-sass output. Differences reduce to the main navigation button gaining the fallback, and sixth-decimal letter-spacing rounding. npm ci and npm run build reproduce the committed bytes on Node 20 and 24.

This branches from trunk. #13379 stacks the same commits on #11776, where the previously failing build job passes on Node.js 24.

Trac ticket: https://core.trac.wordpress.org/ticket/65451

Use of AI Tools

AI assistance: Yes
Tool(s): Claude Code, Codex
Model(s): Claude Opus 5, GPT-5.4
Used for: Diagnosing the failure, the dependency swap, and differential testing of the output; reviewed and verified by me.

​@manzoorwani.jk commented on ​PR #11776:


2 months ago
#15

When are we planning to merge this?

​@desrosj commented on ​PR #11776:


2 months ago
#16

This was committed in r63539, I just forgot to close this PR out.

#17 @desrosj
2 months ago

In 63647:

Build/Test Tools: Increase the shorter timeout just a bit.

In r63643 a timeout value of 3 was added to each npm install step to avoid runaway tasks after the Node.js 24.x update in r63539. This is causing a higher than usual number of runs to timeout because the change was made to reusable workflows due to older branches having more dependencies defined prior to r61438.

This increases the timeout-minutes value to 5 to allow enough of a grace period for oolder branches to complete npm install while still catching any hanging commands within branches using 24.x.

See #66116, #65845, #65451.

This ticket was mentioned in ​PR #13834 on ​WordPress/wordpress-develop by ​@manzoorwani.jk.


7 weeks ago
#18

Upgrades the 7.1 branch to Node.js 24.x, since Node.js 20.x reached end of life on April 30, 2026. Backports r63539 and r63771 without the Gutenberg hash change. Twenty Nineteen and Twenty Twenty keep their current Node.js versions, as in trunk.

Use of AI Tools

AI assistance: Yes
Tool(s): Claude Code
Model(s): Claude Opus 5.5
Used for: Porting the trunk changes to each release branch.

This ticket was mentioned in ​PR #13835 on ​WordPress/wordpress-develop by ​@manzoorwani.jk.


7 weeks ago
#19

Upgrades the 7.0 branch to Node.js 24.x, since Node.js 20.x reached end of life on April 30, 2026. Backports r63539 and r63771 without the Gutenberg hash change. Twenty Nineteen and Twenty Twenty keep their current Node.js versions, as in trunk.

Use of AI Tools

AI assistance: Yes
Tool(s): Claude Code
Model(s): Claude Opus 5.5
Used for: Porting the trunk changes to each release branch.

This ticket was mentioned in ​PR #13836 on ​WordPress/wordpress-develop by ​@manzoorwani.jk.


7 weeks ago
#20

Upgrades the 6.9 branch to Node.js 24.x, since Node.js 20.x reached end of life on April 30, 2026. Backports r63539 and r63771 without the Gutenberg hash change, applying the Grunt workaround to the npm scripts by hand since tools/gutenberg/utils.js does not exist here. Twenty Nineteen and Twenty Twenty keep their current Node.js versions, as in trunk.

Use of AI Tools

AI assistance: Yes
Tool(s): Claude Code
Model(s): Claude Opus 5.5
Used for: Porting the trunk changes to each release branch.

This ticket was mentioned in ​PR #13837 on ​WordPress/wordpress-develop by ​@manzoorwani.jk.


7 weeks ago
#21

Upgrades the 6.8 branch to Node.js 24.x, since Node.js 20.x reached end of life on April 30, 2026. Backports r63539 and r63771 without the Gutenberg hash change, applying the Grunt workaround to the npm scripts by hand since tools/gutenberg/utils.js does not exist here. Twenty Nineteen and Twenty Twenty keep their current Node.js versions, as in trunk.

Supersedes #11718.

Use of AI Tools

AI assistance: Yes
Tool(s): Claude Code
Model(s): Claude Opus 5.5
Used for: Porting the trunk changes to each release branch.

This ticket was mentioned in ​PR #13838 on ​WordPress/wordpress-develop by ​@manzoorwani.jk.


7 weeks ago
#22

Upgrades the 6.7 branch to Node.js 24.x, since Node.js 20.x reached end of life on April 30, 2026. Backports r63539 and r63771 without the Gutenberg hash change, applying the Grunt workaround to the npm scripts by hand since tools/gutenberg/utils.js does not exist here. Twenty Nineteen and Twenty Twenty keep their current Node.js versions, as in trunk.

Use of AI Tools

AI assistance: Yes
Tool(s): Claude Code
Model(s): Claude Opus 5.5
Used for: Porting the trunk changes to each release branch.

This ticket was mentioned in ​PR #13839 on ​WordPress/wordpress-develop by ​@manzoorwani.jk.


7 weeks ago
#23

Upgrades the 6.6 branch to Node.js 24.x, since Node.js 20.x reached end of life on April 30, 2026. Backports r63539 and r63771 without the Gutenberg hash change, applying the Grunt workaround to the npm scripts by hand since tools/gutenberg/utils.js does not exist here. Twenty Nineteen and Twenty Twenty keep their current Node.js versions, as in trunk.

Supersedes #11717.

Use of AI Tools

AI assistance: Yes
Tool(s): Claude Code
Model(s): Claude Opus 5.5
Used for: Porting the trunk changes to each release branch.

This ticket was mentioned in ​PR #13840 on ​WordPress/wordpress-develop by ​@manzoorwani.jk.


7 weeks ago
#24

Upgrades the 6.5 branch to Node.js 24.x, since Node.js 20.x reached end of life on April 30, 2026. Backports r63539 and r63771 without the Gutenberg hash change, applying the Grunt workaround to the npm scripts by hand since tools/gutenberg/utils.js does not exist here. Twenty Nineteen and Twenty Twenty keep their current Node.js versions, as in trunk.

Use of AI Tools

AI assistance: Yes
Tool(s): Claude Code
Model(s): Claude Opus 5.5
Used for: Porting the trunk changes to each release branch.

This ticket was mentioned in ​PR #13841 on ​WordPress/wordpress-develop by ​@manzoorwani.jk.


7 weeks ago
#25

Upgrades the 6.4 branch to Node.js 24.x, since Node.js 20.x reached end of life on April 30, 2026. Backports r63539 and r63771 without the Gutenberg hash change, applying the Grunt workaround to the npm scripts by hand since tools/gutenberg/utils.js does not exist here. Twenty Nineteen and Twenty Twenty keep their current Node.js versions, as in trunk.

Supersedes #11726.

Use of AI Tools

AI assistance: Yes
Tool(s): Claude Code
Model(s): Claude Opus 5.5
Used for: Porting the trunk changes to each release branch.

​@mukesh27 commented on ​PR #13841:


7 weeks ago
#26

@manzoorwanijk Can we close #11726 in favour of this PR?

​@manzoorwani.jk commented on ​PR #13841:


7 weeks ago
#27

@manzoorwanijk Can we close #11726 in favour of this PR?

Done.

This ticket was mentioned in ​PR #13843 on ​WordPress/wordpress-develop by ​@mukesh27.


7 weeks ago
#28

Trac ticket: https://core.trac.wordpress.org/ticket/65451

Follow-up to r63539.

Use of AI Tools

​@mukesh27 commented on ​PR #13841:


7 weeks ago
#29

Thanks! Let's bump node and npm versions in README.MD file similar to #13843

​@mukesh27 commented on ​PR #13840:


7 weeks ago
#30

Let's bump node and npm versions in README.MD file similar to #13843

​@mukesh27 commented on ​PR #13839:


7 weeks ago
#31

Let's bump node and npm versions in README.MD file similar to #13843

​@mukesh27 commented on ​PR #13838:


7 weeks ago
#32

Let's bump node and npm versions in README.MD file similar to #13843

​@mukesh27 commented on ​PR #13837:


7 weeks ago
#33

Let's bump node and npm versions in README.MD file similar to #13843

​@mukesh27 commented on ​PR #13836:


7 weeks ago
#34

Let's bump node and npm versions in README.MD file similar to #13843

​@mukesh27 commented on ​PR #13835:


7 weeks ago
#35

Let's bump node and npm versions in README.MD file similar to #13843

​@mukesh27 commented on ​PR #13834:


7 weeks ago
#36

Let's bump node and npm versions in README.MD file similar to #13843

#37 @lancewillett
7 weeks ago

In 64025:

Docs: Update Node.js and npm versions in the README.

Document Node.js 24.x and npm 11.x as the supported versions, matching the development environment requirements.

Follow-up to [63539].

Developed in: ​https://github.com/WordPress/wordpress-develop/pull/13843

Props mukesh27, manzoorwanijk.
See #65451.

This ticket was mentioned in ​Slack in #core by im3dabasia1. ​View the logs.


3 weeks ago

​@desrosj commented on ​PR #13380:


12 days ago
#40

It looks like this was addressed as part of r64387.

This ticket was mentioned in ​PR #13338 on ​WordPress/wordpress-develop by ​@desrosj.


12 days ago
#41

The ​`@double-great/stylelint-a11y` package is a seemingly well maintained fork of the original stylelint-a11y, which has not been updated for over 7 years and is incompatible with newer versions of Stylelint and Node.js.

This PR:

  • Replaces stylelint-a11y with the latest version of @double-great/stylelint-a11y (^3.8.3).
  • Replaces the deprecated stylelint-config-wordpress with @wordpress/stylelint-config in .stylelintrc.json.
  • Adds :focus selectors to the editor's Button and File block hover styles to match the front end. In the editor, these elements are RichText (contenteditable) fields and do receive focus. This resolves the only a11y/selector-pseudo-class-focus violation.
  • Updates Twenty Twenty to Node.js 24.x (.nvmrc, engines, and devEngines), bringing it in line with Core and the other default themes. This was the last remaining item for Core-65451.

The theme's build output is unchanged on Node.js 24.x. npm run lint:css now runs again, but it reports existing violations of other rules from the newer @wordpress/stylelint-config (mostly selector-class-pattern for block class names). These can be addressed in a follow-up.

Trac ticket: Core-66004.
See Core-65451.

Use of AI Tools

Cursor with Composer 2.5 was used to analyze the situation for possible ways to fix this issue. Claude Code (Claude Opus 5.5) was used to verify the editor focus behavior, update the editor styles, upgrade the theme to Node.js 24.x, and update the dependency.

---
This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See ​GitHub Pull Requests for Code Review in the Core Handbook for more details.

🤖 Generated with ​Claude Code

​https://claude.ai/code/session_011Y86gx8u886tnkeJXZCUR1

​@desrosj commented on ​PR #13338:


12 days ago
#42

@sabernhardt I think this is ready to go. Do you mind giving it a review?

#43 @desrosj
12 days ago

I think the only thing remaining for trunk is to review and commit the PR on #66004.

As far as updating older branches, it seems like the workflow that tests the gutenberg build process within the src/wp-content/plugins directory fails on every branch 6.9 through 6.5 because of the Node.js mismatch.

One way to fix this would be to update the wp/x.y branch in gutenberg first. Then this should pass when the corresponding wordpress-develop branch is updated to use 24.x.

Another option is to simply remove those jobs from these branches. They were removed in r61438 and all branches >=7.0 no longer perform this type of testing. When introduced it was meant to ensure no problems were introduced for contributors who had gutenberg cloned into the src/wp-content/plugins directory. I don't think that's that important anymore within old branches.

I am currently leaning towards removing those jobs, but would love some additional opinions. Tagging a few other component maintainers: @jorbin @johnbillion @lucatume @adrianmoldovanwp @lancewillett.

Just to rehash, the ideal end state is for all branches using Node.js 20.x to be upgraded to now use 24.x, which brings tooling across branches in to a more consistent state. This would mean 7.1-6.4 would run 24.x, and 6.3-4.7 would run 14.x.

#44 @desrosj
12 days ago

Also pinging @manzoorwanijk who prepared the backport PRs as I don't believe activity on GH will subscribe someone to Trac ticket updates.

#45 follow-up: @jonsurrell
11 days ago

I've been researching this and I believe every branch from 4.7 up, in Core and the Gutenberg wp/x.y branches, can move to 24.x with minimal changes. Built files match the shipped releases. I didn't check QUnit, eslint, e2e, etc, but I'm happy to open PRs and we can get results from CI. Expected changes are like this:

  • 5.1 to 5.7, and Gutenberg wp/6.5 to wp/6.8: regenerate the lockfile with npm install --package-lock-only, because npm 11 rejects entries npm 10 accepted. This is why the Gutenberg build jobs fail on 6.5 to 6.8.
  • 5.0 to 6.0: --openssl-legacy-provider, for md4 hashes under OpenSSL 3.
  • Converted lockfiles: legacy-peer-deps = true in .npmrc (5.9 and 6.3 fail to install without it).
  • 5.5 and 5.6: an overrides entry replacing node-sass (from @wordpress/scripts 12) with sass. The build doesn't use it.

#46 in reply to: ↑ 45 @desrosj
11 days ago

Replying to jonsurrell:

I've been researching this and I believe every branch from 4.7 up, in Core and the Gutenberg wp/x.y branches, can move to 24.x with minimal changes.

Very interesting! And thanks for working on that. In the interest of the 7.2 release and this ticket, let's leave this open only until #66004 is resolved and create a new ticket for tracking the work to upgrade older branches.

#47 @desrosj
11 days ago

  • Keywords fixed-major removed

​@sabernhardt commented on ​PR #13338:


11 days ago
#48

I was wrong about the .wp-block-button__link and .wp-block-file__button elements not receiving the focus state in the editor. With the patch, the text of the button-styled link is underlined as I type within a Button or File block because the div has focus (tabindex=0). This style might not be a problem, but the underline is new and unnecessary in the context.

https://github.com/user-attachments/assets/ea4eb87c-74e6-4002-aeab-2d359b6ddf1e

I also ran the following commands to check for any changes: npm install, npm audit fix, npm dedupe, and npm run build. The ​`audit fix` and ​`dedupe` commands edited the package-lock.json file, which might have further updating if the commands are run again another day.

On a side note, the vendor prefix build process does not work, and I would prefer to remove _those_ dependencies instead of trying to fix them.

#49 @desrosj
8 days ago

  • Owner set to desrosj
  • Resolution → fixed
  • Status new → closed

In 65357:

Twenty Twenty: Update to Node.js 24.x.

This updates the theme's .nvmrc file and the engines field in package.json to require Node.js 24.18.0 and npm 11.16.0, bringing Twenty Twenty in line with Core and the other bundled themes.

This also adds the devEngines configuration used by Core and the other bundled themes, which enforces these minimum versions when installing dependencies or running npm scripts.

Twenty Twenty was the last bundled theme that had not been updated to Node.js 24.x.

Follow-up to r63539, r63870.

Props desrosj, sabernhardt, manzoorwanijk, lucatume.
Fixes #65451. See #66099.

#50 @desrosj
8 days ago

I've opened #66636 to continue working on updating old branches.

I've gone and updated all of the PRs exploring backports to reference the new ticket.

#51 @desrosj
10 hours ago

In 65553:

Build/Test Tools: Update @types/node to version 24.19.2.

This updates @types/node from 20.19.43 to 24.19.2, along with its undici-types dependency, so the type definitions match the Node.js 24.x version that Core requires as of r63539.

@types/node was added while Core still targeted Node.js 20.x and was not updated when Core moved to Node.js 24.x.

Follow-up to r63539, r64025, r65357.

Props desrosj.
See #65451, #65857.

Note: See TracTickets for help on using tickets.