Background
- I want to make sure that no matter the machine (non-windows) that runs my project it will always run with the same, controlled, version of Node.js.
- I currently use npm scripts for my build, as seen here.
- I want to be able to update and control that version of Node.js, preferably from my package.json.
- I think, but I'm really not at all sure, that nvm is the tool to solve this.
- I've looked into a few resources on nvm without reaching the understanding I need of nvm to do what I want to. (which may be due to using the wrong tool for my purposes?)
The Question
What kind of script could I write that would make sure the node version that the remainder of my scripts was run by would be the node version I want?
OR
What tool should I be using instead of nvm? And is there a convenient guide to how to use it for my use case?
Dream Example
What I hope to do would look something like...
"dev":"nvm *Do stuffs?* && npm run restOfDev",