What do you think about clamping the value to valid versions? So if you build with v22 or v23, v20 will be used as the default for the runtime?
Alternatively, maybe follow the same rules as Vercel does with the engine field? I was originally a bit confused with the invalid runtime error because I assumed those rules would apply (and we have >= 20 in our engines), but Nitro setting the runtime takes precedence.
Additional information
[X] Would you be willing to help implement this feature?
Describe the feature
The Vercel preset currently sets its runtime node version based on the version of node used to build the application. https://github.com/unjs/nitro/blob/v2/src/presets/vercel/utils.ts#L19 This caused an issue when updating from Node 20 to 22 (the LTS recently changed) because Vercel does not support Node 22.
What do you think about clamping the value to valid versions? So if you build with v22 or v23, v20 will be used as the default for the runtime?
Alternatively, maybe follow the same rules as Vercel does with the
engine
field? I was originally a bit confused with the invalid runtime error because I assumed those rules would apply (and we have>= 20
in our engines), but Nitro setting the runtime takes precedence.Additional information