Install NVM
#
Aboutnvm is a version manager for node.js, designed to be installed per-user, and invoked per-shell. nvm works on any POSIX-compliant shell (sh, dash, ksh, zsh, bash), in particular on these platforms: unix, macOS, and windows WSL.
#
InstallationRun any of the following commands in your terminal:
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
).
For updated instructions visit:https://github.com/nvm-sh/nvm#installing-and-updating
#
Verify InstallationTo verify that nvm has been installed, do:
which should output nvm
if the installation was successful.
Please note that which nvm
will not work, since nvm
is a
sourced shell function, not an executable binary.
#
UsageTo download, compile, and install the latest release of node, do this:
And then in any new shell just use the installed version: