Title: Updating WordPress to use more modern versions of Node.js/npm
Author: Jonathan Desrosiers
Published: August 9, 2023
Last modified: August 10, 2023

---

 [  ](https://profiles.wordpress.org/desrosj/) [Jonathan Desrosiers](https://profiles.wordpress.org/desrosj/)
7:03 pm _on_ August 9, 2023      

# Updating WordPress to use more modern versions of Node.js/npm

_August 8, 2023: Added a reference to the Node.js and npm tutorial on [learn.wordpress.org](https://learn.wordpress.org/).–
[@desrosj](https://profiles.wordpress.org/desrosj/)_

As of [[56378]](https://core.trac.wordpress.org/changeset/56378) in the CoreCore
Core is the set of software required to run WordPress. The Core Development Team
builds WordPress. SVNSVN Subversion, the popular version control system (VCS) by
the Apache project, used by WordPress to manage changes to its codebase. repository
and [a3bef32](https://github.com/WordPress/gutenberg/commit/a3bef329699f0751a7e3aec9255447f5df94f874)
in the GutenbergGutenberg The Gutenberg project is the new Editor Interface for 
WordPress. The editor improves the process and experience of creating new content,
making writing rich content much simpler. It uses ‘blocks’ to add richness rather
than shortcodes, custom HTML etc. [https://wordpress.org/gutenberg/](https://wordpress.org/gutenberg/)
repository, the versions of Node.js and npm recommended for WordPress development
are now 16.x and 8.x, respectively.

## Required action by contributors

In order to continue contributing to WordPress through `wordpress-develop` or `WordPress/
Gutenberg`, you’ll need to upgrade the version of Node.js installed on your machine
to one that’s greater than or equal to 16.19.1 (the latest is currently (16.20.1).
This should also update npm to the correct, expected version appropriately.

Using [nvm (Node Version Manager)](https://github.com/nvm-sh/nvm) is the recommended
and most common way to change the version of Node.js you are running. Both `wordpress-
develop` and the Gutenberg repositories have an `.nvmrc` file specifying the desired
version. Running `nvm install` within your checkout’s directory will automatically
install the latest version that falls within the defined constraints.

If you need further guidance on how to install or use Node.js, npm, or nvm, there
is a [great tutorial](https://learn.wordpress.org/tutorial/installing-node-js-and-npm-for-local-wordpress-development/)
explaining in great detail on [learn.wordpress.org](https://learn.wordpress.org/).

> [Installing Node.js and npm for local WordPress development](https://learn.wordpress.org/tutorial/installing-node-js-and-npm-for-local-wordpress-development/)

Note: If you have any open pull requests, you will likely need to update your branchbranch
A directory in Subversion. WordPress uses branches to store the latest development
code for each major release (3.9, 4.0, etc.). Branches are then updated with code
for any minor releases of that branch. Sometimes, a major version of WordPress and
its minor versions are collectively referred to as a "branch", such as "the 4.0 
branch". to include these changes to ensure they work and are tested properly.

## How does Node.js versioning work?

Before diving in to some of the background for this change, here is a brief overview
of how the versioning for Node.js releases works:

 * Excluding the `main` branch (which is always considered unstable), there are 
   3 states for versions: current, active (LTS or long term support), and maintenance.
 * Major versions (18.x, 19.x, etc.) are released every April and October.
 * October releases (always odd numbered) have a support life of 8 months: 6 in 
   current state, 2 in maintenance. They enter maintenance state in April when the
   next major version is published.
 * April releases (always even numbered) are converted to active LTS in October 
   after 6 months as the the current version. They remain in active LTS state for
   12 months before moving to maintenance for 18 additional months.

You can read more about this on the [project’s Releases page](https://nodejs.dev/en/about/releases/),
or the project’s [README file on GitHub](https://github.com/nodejs/node#release-types).

## Why only Node.js 16?

While it’s true that version 16 is currently in maintenance mode, 18.x is [currently not an option due to a systems level constraint](https://make.wordpress.org/systems/2023/02/09/upgrade-nodejs-npm-on-the-build-server/).
The systems team is working on resolving the blockerblocker A bug which is so severe
that it blocks a release., and 16.x is the highest that can currently be used.

## What is the blocker?

When a commit is made to develop.svn.wordpress.orgWordPress.org The community site
where WordPress code is created and shared by the users. This is where you can download
the source code for WordPress core, plugins and themes as well as the central location
for community conversations and organization. [https://wordpress.org/](https://wordpress.org/)(
visually represented at [core.trac.wordpress.org](https://core.trac.wordpress.org)
and mirrored to [WordPress/wordpress-develop on GitHub](https://github.com/wordpress/wordpress-develop)),
a private server (known as the build server) checks out the new changeset and executes
the build scripts required to create a production ready version of WordPress. The
results of this process are then committed to build.svn.wordpress.org (visually 
represented at [build.trac.wordpress.org](https://build.trac.wordpress.org/) and
mirrored to [WordPress/WordPress on GitHub](https://github.com/wordpress/wordpress)).
All WordPress releases are created from this repository.

The version of Node.js specified in the `package.json` file within `wordpress-develop`
must be available on the build server. If it’s not present, everything breaks. specifics
about the [WordPress.org](https://wordpress.org/) infrastructure are kept private
and as such the reason behind the blocker will not be disclosed.Until this blocker
for installing Node.js >= 18 is resolved, version 16 must be used.

## Why not update the Gutenberg repo to version 18 and Core to 16?

This was explored but ultimately ruled out. While it would be nice to use the current
active LTS version in the Gutenberg repository, it would make contributing more 
difficult (contributors would have to also install [nvm](https://github.com/nvm-sh/nvm)
or know how to change versions on the fly), and potentially introduce some weird
edge cases where bugs exist in `wordpress-develop` and not the Gutenberg pluginPlugin
A plugin is a piece of software containing a group of functions that can be added
to a WordPress website. They can extend functionality or add new features to your
WordPress websites. WordPress plugins are written in the PHP programming language
and integrate seamlessly with WordPress. These can be free in the WordPress.org 
Plugin Directory [https://wordpress.org/plugins/](https://wordpress.org/plugins/)
or can be cost-based plugin from a third-party./repository.

## Why is the EOL for Node.js 16 this September?

When originally placed in maintenance state, version 16.x was set to receive the
full 18 months of support (until April of 2024). However, a decision has been made
by the [Node.js team to bring the EOL date forward by 7 months](https://nodejs.org/en/blog/announcements/nodejs16-eol).

Node.js 16 was originally released with OpenSSL 1.1.1, which is scheduled for EOL
on September 11, 2023. To ensure there is no risk of exposure to any vulnerabilities
discovered in OpenSSL 1.1.1 between September 2023 and the original EOL date for
Node.js 16 of April 2024, the new EOL date for Node.js 16 is now also September 
11, 2023.

The systems team is aware of this expedited timeline.

## Will version 18 be skipped?

As of the publish date for this post, 18.x is the active LTE version and 20.x is
current. Ideally, when the system-level blocker is resolved the jump directly to
20.x can be made. However, it’s not always that easy or straightforward (see the
fact that the project used 14.x until today).

This will be evaluated when the time comes and it’s possible 18.x is used as an 
intermediate step since maintenance for that release is scheduled through April 
30, 2025. But, it is becoming more common for packages to set minimum version requirements
to the current active LTS. So jumping directly to 20.x could be required after October
2023 (when 20.x becomes active LTS version).

## What does updating to 16.x unblock?

There are several dependencies that the editor team has been looking at using to
support phase 3 of the project (collaborative editing). However, those dependencies
do not support Node.js 14.x. This allows further exploration and experimentation
to take place.

The update also opens the door for exploring how to utilize new features in npm,
such as [workspaces](https://docs.npmjs.com/cli/v8/using-npm/workspaces?v=true).
npm is bundled with Node.js, and the version included is pinned. It’s usually not
recommended to update npm independently from Node.js to avoid incompatibilities.
So unless Node.js is updated to a version that changes the bundled version of npm,
these new features are not reliably available or stable.

## Where can I learn more?

Here is a list of locations where discussions related to these changes took place:

 * [WordPress/wordpress-develop PR-4028](https://github.com/WordPress/wordpress-develop/pull/4028)
 * [WordPress/gutenberg PR-53426](https://github.com/WordPress/gutenberg/pull/53426)
 * [WordPress/gutenberg PR-48950](https://github.com/WordPress/gutenberg/pull/48950)
 * [WordPress/gutenberg PR-52363](https://github.com/WordPress/gutenberg/pull/48950)
 * [#56658](https://core.trac.wordpress.org/ticket/56658) on Core TracTrac An open
   source project by Edgewall Software that serves as a bug tracker and project 
   management tool for WordPress.

This change will likely require some documentation and handbook updates. If you 
notice any adjustments that need to be made, please do point them out in the appropriate
locations so that they can be corrected!

_Props [@youknowriad](https://profiles.wordpress.org/youknowriad/), [@jorbin](https://profiles.wordpress.org/jorbin/),
[@annezazu](https://profiles.wordpress.org/annezazu/), and [@chanthaboune](https://profiles.wordpress.org/chanthaboune/)
for reviewing this post._

### Share this:

 * [  Threads ](https://make.wordpress.org/core/2023/08/09/updating-wordpress-to-use-more-modern-versions-of-node-js-npm/?share=threads)
 * [  Mastodon ](https://make.wordpress.org/core/2023/08/09/updating-wordpress-to-use-more-modern-versions-of-node-js-npm/?share=mastodon)
 * [  Bluesky ](https://make.wordpress.org/core/2023/08/09/updating-wordpress-to-use-more-modern-versions-of-node-js-npm/?share=bluesky)
 * [  X ](https://make.wordpress.org/core/2023/08/09/updating-wordpress-to-use-more-modern-versions-of-node-js-npm/?share=x)
 * [  Facebook ](https://make.wordpress.org/core/2023/08/09/updating-wordpress-to-use-more-modern-versions-of-node-js-npm/?share=facebook)
 * [  LinkedIn ](https://make.wordpress.org/core/2023/08/09/updating-wordpress-to-use-more-modern-versions-of-node-js-npm/?share=linkedin)

 1.  ![](https://secure.gravatar.com/avatar/37699b2f7b137bcf959dadd45e505bb6653ba6a4befa23d0a1beeb43a07457a6?
     s=32&d=mm&r=g)
 2.   [Rich Tabor](https://profiles.wordpress.org/richtabor/)  1:40 am _on_ August 
     10, 2023
 3.  Ran into a little snafu earlier today. In case it helps others, [@desrosj](https://profiles.wordpress.org/desrosj/)
     pointed me in the right direction to run nvm install within /gutenbergGutenberg
     The Gutenberg project is the new Editor Interface for WordPress. The editor improves
     the process and experience of creating new content, making writing rich content
     much simpler. It uses ‘blocks’ to add richness rather than shortcodes, custom 
     HTML etc.
      [https://wordpress.org/gutenberg/](https://wordpress.org/gutenberg/)
     to pull the version specified in the .nvmrc file and install the newest version
     possible based on the constraints there.
 4.  ![](https://secure.gravatar.com/avatar/a61af5cd9a78137214c3f0b276a3d07bdb931397f4d7861ce6b818fd062b542d?
     s=32&d=mm&r=g)
 5.   [Greg Ziółkowski](https://profiles.wordpress.org/gziolo/)  9:34 am _on_ August
     10, 2023
 6.  Excellent summary of the current status.
 7.  For the GutenbergGutenberg The Gutenberg project is the new Editor Interface for
     WordPress. The editor improves the process and experience of creating new content,
     making writing rich content much simpler. It uses ‘blocks’ to add richness rather
     than shortcodes, custom HTML etc.
      [https://wordpress.org/gutenberg/](https://wordpress.org/gutenberg/)
     part, we still need to pick more changes prepared by [@kevin940726](https://profiles.wordpress.org/kevin940726/)
     in [https://github.com/WordPress/gutenberg/pull/48950](https://github.com/WordPress/gutenberg/pull/48950):
 8.   * All documentation changes where Node 14 and npm 6 was listed as the requirement
        for contribution and pluginPlugin A plugin is a piece of software containing
        a group of functions that can be added to a WordPress website. They can extend
        functionality or add new features to your WordPress websites. WordPress plugins
        are written in the PHP programming language and integrate seamlessly with WordPress.
        These can be free in the WordPress.org Plugin Directory [https://wordpress.org/plugins/](https://wordpress.org/plugins/)
        or can be cost-based plugin from a third-party./theme development.
      * Initiate breaking changes in all WordPress packages to increase the minimum
        Node and npm (where applicable, we might be able to drop the npm part as discussed).
      * Enable support for npm workspaces.
 9.  There might be more work ready to land in the branchbranch A directory in Subversion.
     WordPress uses branches to store the latest development code for each major release(
     3.9, 4.0, etc.). Branches are then updated with code for any minor releases of
     that branch. Sometimes, a major version of WordPress and its minor versions are
     collectively referred to as a "branch", such as "the 4.0 branch". 😄
 10. Finally, we should remove the `legacy-peer-deps` flag override and start using
     the new npm handling of peer dependencies. This might require some audit of how
     we handle peer dependencies in WordPress packages and increase the usage of this
     good practice.
 11.  * ![](https://secure.gravatar.com/avatar/18f4f7ebdcd48383951a52a88f401bd6460ae74b626016010b1f0604cac90826?
        s=32&d=mm&r=g)
      *  [Jonathan Desrosiers](https://profiles.wordpress.org/desrosj/)  12:33 pm _on_
        August 10, 2023
      * Thanks for adding this context, Greg!

Comments are closed.

# Post navigation

[← Dev Chat agenda, August 9, 2023](https://make.wordpress.org/core/2023/08/09/dev-chat-agenda-august-9-2023/)

[What’s new in Gutenberg 16.4? (9 August) →](https://make.wordpress.org/core/2023/08/10/whats-new-in-gutenberg-16-4-9-august/)