Install the nvm.fish plugin
For this you need to first have the fisher plugin manager installed: install fisher
fisher install jorgebucaran/nvm.fish
Using NVM
Install the latest Node release and activate it.
nvm install latest
Install the latest LTS Node release
nvm install lts
Install a specific version of NodeJs
nvm install v15.3.0
Activate a node version you've already installed
nvm use v14
List the installed version of nodejs (includes your system-installed one, if present)
nvm list
List all node versions that can be installed
nvm list-remote
Uninstall a node version
nvm uninstall v15.3.0
NVM version for different projects
A .nvmrc
file makes it easy to lock a specific version of Node for different projects. For this, we need to create the .nvmrc
file in the root directory of the project and specify the required node version in it. If the version currently being used is the version needed for the project then you can create the file using the command
node --version >.nvmrc
Then run the nvm install
to install or nvm use
to activate that version. These can be called from anywhere inside the project