wasp-lang / wasp

The fastest way to develop full-stack web apps with React & Node.js.
https://wasp-lang.dev
MIT License
13.32k stars 1.18k forks source link

Add `.nvmrc` when generating a project with `wasp new` #1013

Open infomiho opened 1 year ago

infomiho commented 1 year ago

We require a certain Node.js version to be available when running wasp start, it would be nice for users to have a .nvmrc file available in the project dir.

This would enable users to execute nvm use when they want to use the correct Node.js version instead of remembering that they need to use Node.js 18 and execute nvm use 18.

Martinsos commented 1 year ago

Not a bad idea! What when they upgrade their wasp version and need to update .nvmrc, is that a bother? What if they are not using nvm (well they probably are but still)?

Zeko369 commented 1 year ago

IMO the upgrade problem is really easy to get around, in a case wasp upgrades, you can just change the engines.node path in package.json to require something higher and it's going to throw when running it with an older version so users can upgrade

Preview of the most popular tooling and how they handle .nvmrc

So IMO this would fix a lot of problems (including some problems I had with wasp out of the box)

Martinsos commented 1 year ago

@Zeko369 thanks for this analysis, this makes quite a lot of sense then! Yeah, I am in for it then, it can't hurt. It should also be easy for users to create their own .nvmrc though, right? I mean if they need to know how to update it, we can also expect them to be able to create their own? But you think it helps if they get it right off the bat, because it makes it clear that Wasp is expecting a specific node version and they can just do nvm use? Ok, makes sense.