'How to specify the node version for rails app?
I changed the node version in one rails app, which I believe changed the node version globally (i.e. for the whole of my laptop), which isn't desirable (I prefer to keep different apps on different node versions until they're ready to be upgraded).
Can I set the node version on a per app basis somehow?
E.g. analogously to how we can specifiy a ruby version on a per-app basis by creating a file called .ruby-version with the version number in it.
Solution 1:[1]
You can install nvm, and then place a .nvmrc file containing the version number in the root of your project.
Installing via
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash
will attempt to add the initializer to your appropriate shell configuration.
See https://github.com/nvm-sh/nvm#installing-and-updating for installation options.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 |
