#1593·wasp

Obtain user node version range from their package.json engines field

Author: MartinsosCreated Dec 6, 2023Updated Sep 30, 2026
Labelsenhancementrestructuring

Continuation on #1533 .

Once we implement The Restructuring, the user will be able to specify the node version range in their package.json engines field.

If they do so, we should pick that up (parse package.json and read that field) and based on that, update userNodeVersionRange in waspc/src/Wasp/AppSpec.hs to use that as its value, instead of deriving its value from Wasp's node version range.

Note/Question: Right now, we will throw warning if user node version range spans multiple major versions. Is that too aggressive? What about engineStrict field, should we also throw warning if that one is not set to true? Is it ok to throw warning for just one of these, but not for the other? What if they want to turn these warnings off, should we give them some way to do that? We could allow them to specify in main.wasp which warnings to skip, and then in AppSpec/Valid.hs we can make sure to filter out those warnings.

Idea: When they create a new project, I think we should put in some nice default values in their package.json that we generate for them. We should put engineStrict field to true, and we should put engines.node to ^<some_version>. To figure out which version, I suggest we either ask them, or we figure out their current node version at that moment and use that.

Docs: We should add a portion in docs where we explain this situation with node versions, how and why we strongly recommend they don't span multiple major versions in their node version range, and why we strongly recommend they have engineStrict set to true.