How to avoid automatic Node.js download during Vaadin 14 production build?


We are facing an issue with Vaadin 14.10.0 production build. Although we have Node.js v18.16.1 installed in our build machine, the build process is trying to download Node.js v10.16.0, which sometimes fails with error 500. Here’s the error log:

[INFO] Installing node version v10.16.0
[INFO] Downloading to /x/target/cache/node-v10.16.0-linux-x64.tar.gz
[ERROR] Failed to execute goal com.vaadin:vaadin-maven-plugin:14.10.0:package-for-production (default) on project x: Execution default of goal com.vaadin:vaadin-maven-plugin:14.10.0:package-for-production failed: Failed to download node: Could not download Node.js: Got error code 500 from the server. -> [Help 1]

Our expectation is for the build process to use the already installed Node.js version instead of attempting to download v10.16.0. If needed, we can downgrade Node.js, but Vaadin 14 docs explicitly say “We recommend using the latest LTS version” (which is v18.16.1 as of today, v10 is ancient). Could you please guide us on how to rectify this? Thanks in advance!

This seems really weird. V14 has node 14.x as default

There’s something weird here. Default node for Vaadin 14.10 is v14.21.3
And, if there’s a gloal node installed, it should be used if supported and no specific configurations for the vaadin maven plugin are present in pom file

You can try to run the build with -X flag and check if there’s somethin interesting in the logs

Can it be caused by compatibility mode?

Possible… using Vaadin 14.10 with compatibility mode is probably not something a lot of people are doing

Seems highly probable, since the maven goal is package-for-production and not build-frontend

If you really need to use the package-for-production goal you can try to set autodetectTools=true or nodeVersion=14.x.y in the plugin configuration

Or use system properties to set the values

Right, let’s assume it is caused by the compatibility mode. Getting rid of it is on our roadmap, we can live with this till then.