I’m encountering a build error on Vercel related to Node.js version:
Running "install" command: `yarn install --frozen-lockfile`...
yarn install v1.22.19
[1/5] Validating package.json...
error [repo]: The engine "node" is incompatible with this module. Expected version ">=22.18.0 <23.0.0". Got "22.17.1"
error Found incompatible module.
I found that it isn’t recommended to do this range but I was hoping to try Node.js 22.18 since the type stripping is enabled by default in this version.
Also, I’ve noticed that Yarn 1.22.19 is being used in the build environment, despite 1.22.22 being the latest stable version of Yarn 1.x.
My question is around when do this typically gets upgraded? Only when severety happens on the minor or patch version that requires an update? If so, can we put a fixed version? I remember in the docs that we can’t do it in Node but how about yarn?
My questions are:
- When do Vercel build environments typically get upgraded to include the latest patch or minor versions of Node.js (e.g., from 22.17.1 to 22.18.0)? Is this typically only for critical security fixes or major version bumps?
- Is there a way for us to specify or enforce a fixed Node.js patch version (like 22.18.0) or a specific Yarn version (1.22.22) within our Vercel build configuration? I understand that directly fixing Node.js versions might not be recommended or possible per the Vercel docs, but I’m curious if there are any new developments or workarounds, especially regarding Yarn.