Skip to content

Commit d522886

Browse files
committed
Build/Test Tools: Raise minimum required version of Node.js/npm.
This bumps the minimum required version of Node.js/npm from 16.19.1 and 8.19.3 to 20.10.0 and 10.2.3. Since 20.10.0 is the latest 20.x version of Node.js, the `check-latest` option has been enabled for `actions/setup-node` in GitHub Actions workflows. This performs an additional external call to the Node.js API confirming the latest version is installed on the runner for use. In testing, it seems that 20.10.0 was not consistently deployed to all runner machines in use. This should be removed in the near future when the version of Node.js is reliably above the new minimum requirement. The Gutenberg repository has also been updated to use the same values for `engines`. Props jorbin, joemcgill, swissspidy, benharri, dhrupo, flootr, gziolo, noahtallen. See #59663. git-svn-id: https://develop.svn.wordpress.org/trunk@57212 602fd350-edb4-49c9-b593-d223f7449a82
1 parent c6773ee commit d522886

7 files changed

+22
-6
lines changed

.github/workflows/callable-test-core-build-process.yml

+1
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ jobs:
4949
uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 # v4.0.0
5050
with:
5151
node-version-file: '.nvmrc'
52+
check-latest: true
5253
cache: npm
5354

5455
- name: Log debug information

.github/workflows/callable-test-gutenberg-build-process.yml

+1
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ jobs:
5757
uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 # v4.0.0
5858
with:
5959
node-version-file: '.nvmrc'
60+
check-latest: true
6061
cache: npm
6162
cache-dependency-path: |
6263
package-lock.json

.github/workflows/performance.yml

+14
Original file line numberDiff line numberDiff line change
@@ -71,12 +71,14 @@ jobs:
7171
# - Run performance tests (current commit).
7272
# - Print performance tests results.
7373
# - Check out target commit (target branch or previous commit).
74+
# - Switch Node.js versions if necessary.
7475
# - Install npm dependencies.
7576
# - Build WordPress.
7677
# - Run any database upgrades.
7778
# - Run performance tests (previous/target commit).
7879
# - Print target performance tests results.
7980
# - Reset to original commit.
81+
# - Switch Node.js versions if necessary.
8082
# - Install npm dependencies.
8183
# - Set the environment to the baseline version.
8284
# - Run any database upgrades.
@@ -190,6 +192,12 @@ jobs:
190192
fi
191193
git reset --hard $TARGET_SHA
192194
195+
- name: Set up Node.js
196+
uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # v3.8.1
197+
with:
198+
node-version-file: '.nvmrc'
199+
cache: npm
200+
193201
- name: Install npm dependencies
194202
run: npm ci
195203

@@ -212,6 +220,12 @@ jobs:
212220
- name: Reset to original commit
213221
run: git reset --hard $GITHUB_SHA
214222

223+
- name: Set up Node.js
224+
uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # v3.8.1
225+
with:
226+
node-version-file: '.nvmrc'
227+
cache: npm
228+
215229
- name: Install npm dependencies
216230
run: npm ci
217231

.nvmrc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
16
1+
20

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ You will need Node and npm installed on your computer. Node is a JavaScript runt
3535

3636
If you are not using a package manager, see the [Node.js download page](https://nodejs.org/en/download/) for installers and binaries.
3737

38-
**Note:** WordPress currently only officially supports Node.js `16.x` and npm `8.x`.
38+
**Note:** WordPress currently only officially supports Node.js `20.x` and npm `10.x`.
3939

4040
You will also need [Docker](https://www.docker.com/products/docker-desktop) installed and running on your computer. Docker is the virtualization software that powers the local development environment. Docker can be installed just like any other regular application.
4141

package-lock.json

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
"url": "https://develop.svn.wordpress.org/trunk"
88
},
99
"engines": {
10-
"node": ">=16.19.1",
11-
"npm": ">=8.19.3 <9"
10+
"node": ">=20.10.0",
11+
"npm": ">=10.2.3"
1212
},
1313
"author": "The WordPress Contributors",
1414
"license": "GPL-2.0-or-later",

0 commit comments

Comments
 (0)