nvm can be defined as a Node Version Manager. It is a command line tool that helps web developers to manage and shift between their versions of node. Currently, nvm only works on any POSIX-compliant shell (sh, dash, ksh, zsh, bash), in particular on these platforms: unix, macOS, and windows WSL.
Node evolves quite quickly. As a result, your old project that used the old node may not work as expected. It is super annoying to just switch different node versions for different projects in your local environment. Here nvm came and played a role to overcome this problem.
To ensure you have installed the right version, kindly read this documentation:
Curl or wget to install nvm:
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | bash
wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | bash
Verify the installation:
command -v nvm # It should display "nvm" if the installation was successful.
nvm install node
nvm install 10.2.1
nvm use node
nvm use 10.2.1
nvm ls
npm uninstall 11.1.1
In conclusion, nvm is a good tool. It really helps web developers to deal with a lot of projects with different versions of node. Thank you for reading this article. I hope it helped you in some way.