I know I can change the node version by nvm use
CLI command. However, I want to set specific node version differently for a certain project(folder). It's changed via nvm use
command but it's reverted to default version
whenever I restart the terminal
or webstorm
IDE.
How can I set nvm
remember this different version for a certain project(folder)?
Switching among Node. 7; we can simply run either nvm use 12.22. 7 or nvm use 16.13. 0 to easily switch into either version we need. Note that since we only have one version that begins with 12, 14, or 16, we can switch versions with a simple nvm use 16 , nvm use 14 , or nvm use 12 command.
Node Version Manager (NVM) is a great tool and easy to switch between multiple node versions while working on projects that required different NodeJs versions. It saves a lot of development time by just switching to the version of nodejs needed.
To change Node. JS versions, we have to first download the version we want. Make sure you have nvm installed first. If you don't know the version you want to install, type nvm ls-remote to get a full list of all installable Node.
You can use an .nvmrc
file in the root of the project with the version you want to use. For example v12.4.0
or v10.16.0
.
You have to make sure that this version is installed or it will use the default node version in your machine.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With