nvm - program cheatsheet
nvm allows you to quickly install and use different versions of node via the command line.
repo: github.com/nvm-sh/nvm
examples
$ nvm use 16
Now using node v16.9.1 (npm v7.21.1)
$ node -v
v16.9.1
$ nvm use 14
Now using node v14.18.0 (npm v6.14.15)
$ node -v
v14.18.0
$ nvm install 12
Now using node v12.22.6 (npm v6.14.5)
$ node -v
v12.22.6
install nvm
using curl
using wget Running either of the above commands downloads a script and runs it. The script clones the nvm repository to~/.nvm
, and attempts to add the source lines from the snippet below to the correct profile file (~/.bash_profile
, ~/.zshrc
, ~/.profile
, or ~/.bashrc
).
* paste this into your current bash session or restart your session for the program to become available.