Skip to content

Commit

Permalink
Build/Test Tools: Raise minimum required version of Node.js/npm.
Browse files Browse the repository at this point in the history
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
  • Loading branch information
desrosj committed Dec 20, 2023
1 parent c6773ee commit d522886
Show file tree
Hide file tree
Showing 7 changed files with 22 additions and 6 deletions.
1 change: 1 addition & 0 deletions .github/workflows/callable-test-core-build-process.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ jobs:
uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 # v4.0.0
with:
node-version-file: '.nvmrc'
check-latest: true
cache: npm

- name: Log debug information
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ jobs:
uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 # v4.0.0
with:
node-version-file: '.nvmrc'
check-latest: true
cache: npm
cache-dependency-path: |
package-lock.json
Expand Down
14 changes: 14 additions & 0 deletions .github/workflows/performance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,14 @@ jobs:
# - Run performance tests (current commit).
# - Print performance tests results.
# - Check out target commit (target branch or previous commit).
# - Switch Node.js versions if necessary.
# - Install npm dependencies.
# - Build WordPress.
# - Run any database upgrades.
# - Run performance tests (previous/target commit).
# - Print target performance tests results.
# - Reset to original commit.
# - Switch Node.js versions if necessary.
# - Install npm dependencies.
# - Set the environment to the baseline version.
# - Run any database upgrades.
Expand Down Expand Up @@ -190,6 +192,12 @@ jobs:
fi
git reset --hard $TARGET_SHA
- name: Set up Node.js
uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # v3.8.1
with:
node-version-file: '.nvmrc'
cache: npm

- name: Install npm dependencies
run: npm ci

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

- name: Set up Node.js
uses: actions/setup-node@5e21ff4d9bc1a8cf6de233a3057d20ec6b3fb69d # v3.8.1
with:
node-version-file: '.nvmrc'
cache: npm

- name: Install npm dependencies
run: npm ci

Expand Down
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
16
20
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ You will need Node and npm installed on your computer. Node is a JavaScript runt

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

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

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.

Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
"url": "https://develop.svn.wordpress.org/trunk"
},
"engines": {
"node": ">=16.19.1",
"npm": ">=8.19.3 <9"
"node": ">=20.10.0",
"npm": ">=10.2.3"
},
"author": "The WordPress Contributors",
"license": "GPL-2.0-or-later",
Expand Down

0 comments on commit d522886

Please sign in to comment.