How to install Node.js with node version manager(nvm)
Using nvm(node version manager) it very easier to install and manage multiple version of Node.js. We can switch from one version to another version.
- Download and run script
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.2/install.sh | bash - Restart terminal or update profile
source ~/.bashrc - Verify nvm version
nvm — version - Install latest LTS(Long Term Support) of Node.js
nvm install — lts - Verify Node.js version
node — version - List available version
nvm ls-remote - Install specific version
nvm install 16.18.0 - Install latest release
nvm install node - List installed version
nvm ls - Switch to another version
nvm use 14.16.0
You should now be all set to execute and work on your Node.js projects no matter which version of Node.js they are written for.
Need to identify version of project and according to this choose version and run/build projects.