Set NODE_VERSION to fix Node compilation errors

If you’re running into Node compilation issues, please pin your Node version to 12, ideally using the NODE_VERSION environment variable, or other methods described in Specifying a Node Version.

For example, you can set the value of NODE_VERSION to <13 if you’d like to stay on Node 12.

I’m not sure if this is the correct place for a bug report, but I have recently tried setting the Node.js version using "engines": {"node": ">=15"}, but this intermittently fails (but when I manually redeploy, then it works again):

Jan 8 09:38:00 AM   ==> Checking out commit 11091972875cc1a30219705707b0b906147da9ae in branch main
Jan 8 09:38:03 AM   ==> Downloading cache...
Jan 8 09:41:11 AM   ==> Detected Node version 12.16.2

...

Jan 8 09:41:12 AM   yarn install v1.22.4
Jan 8 09:41:13 AM   [1/5] Validating package.json...
Jan 8 09:41:13 AM   error upleveled@1.0.0: The engine "node" is incompatible with this module. Expected version ">=15". Got "12.16.2"
Jan 8 09:41:13 AM   error Found incompatible module.

Seems like it could be an issue with the “cache”?

I’m going to try additionally adding the .node-version file, but would be nice to be able to use engines reliably…

1 Like

Hm, nope, .node-version also fails intermittently, same problem.

I’ll try with NODE_VERSION

1 Like

yes NODE_VERSION works fine for me i have set NODE_VERSION to v16.0.0 and it works fine for me

1 Like