Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
infomiho opened this issue Feb 20, 2023 · 3 comments
Open

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

infomiho opened this issue Feb 20, 2023 · 3 comments
Labels
dx enhancement New feature or request

Comments

@infomiho
Copy link
Contributor

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.

@infomiho infomiho added the enhancement New feature or request label Feb 20, 2023
@Martinsos
Copy link
Member

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
Copy link
Collaborator

Zeko369 commented Mar 22, 2023

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

  • nvm -> lodas .nvmrc
  • fnm -> lodas .nvmrc
  • n -> loads .nvmrc
  • asdf-nodejs -> can easily be made to load .nvmrc
  • nvm-windows -> kinda hacky, but you can do it

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

@Martinsos Martinsos added the dx label Apr 3, 2023
@Martinsos
Copy link
Member

@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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dx enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants