1. Introduction (What is NVM)
Node version manager, which installs and maintains multiple node versions on the machine
2, NVM temporary switch (temporarily switch version, only valid in the current terminal, the new open terminal is invalid. )
(1) If you have not installed NPM, please install NPM first
(2) Subsequent installation of NVM:
CD NVM
SOURCE nvm.sh
git clone https://github.com/creationix/nvm.git
(3) Check the NVM installation version
NVM--version
(4) Install the specified node version
NVM Install <version>
(5) Select the version to use
NVM use <version>
(6) Delete the specified version
NVM Install <version>
3, NVM Permanent switch (reference link: https://www.geekjc.com/post/58b4ee31c8c6ea16bd304460)
(1) Use Homebrew to install:
Brew Install NVM
(2) After the installation is complete, enter the following line directly
" Source $ (Brew--prefix NVM)/nvm.sh " >>. Bash_profile
(3) Re-source your. Bash_profile to let the setting take effect
. ~/.bash_profile
(4) Install the specified node version
NVM Install <version>
(5) After the installation is complete, use NVM to switch versions
NVM use--delete-prefix <version> (example: NVM use--delete-prefix v4.6.2)
Install NVM Management Multi-version Nodejs