Coming Soon: Node 20

Liferay is busy updating the Node version used for builds from Node 16 to Node 20.

Liferay is busy working on updating the Node version used by the Gradle plugins in the Gradle Workspace from Node 16.13.0 (or 16.15.1 depending upon where you look) to Node 20.12.2.

I'm told that this update is only supposed to apply to new versions of Liferay greater than GA117 and U117 (which means the upcoming 2024.Q2 release and later).

I'm also told that it only affects the build, it has no impact on the runtime, so even if you updated the workspace plugin and somehow started using Node 20, your builds should still be fine and your runtime unaffected.

Fortunately if you do end up using Node 20 because you've updated your workspace plugins or some other oddity occurs, you can force the use of Node 16.

Just edit the build.gradle file in the root of your workspace and assign the node version by adding the following lines:

node {
  nodeVersion = "16.15.1"
}

This example, taken from the Liferay Samples Workspace for CX, is using Node 16.15.1.

It may be tempting to say "Liferay doesn't update Node often enough, I'm going to pick my own version..." I have to recommend against this. Liferay tests its builds against specific versions, not all versions. While you might be able to change a version and see no obvious failures, that doesn't mean they might not be there and could lead to instability in your builds and/or artifacts.

When the build occurs, the Liferay gradle plugins will download this version of node to use during the build process. If you don't override the version in build.gradle, then the default version (in the soon to be released plugins) will be used, or 20.12.2.

Anyway, hope this helps!