What is NVM?
The Node Version Manager (NVM) is the Nodejs Version Manager. It can quickly switch between different Node versions.
Why NVM?
There are more and more Node-based tools and projects, but each project may not use the same version of Node, which can cause some strange problems. For example, if you have the latest version of Node installed on your computer and the project you’re working on is using an earlier version of Node. So I have to switch to an earlier version of Node so I don’t get an error. NVM is designed to help you switch node versions quickly.
NVM installation process in Linux
Open the address of NVM on Github: github.com/nvm-sh/nvm
The curl - o - https://raw.githubusercontent.com/nvm-sh/nvm/v0.34.0/install.sh | bash
So when you use the NVM list it tells you that the NVM doesn’t exist
source ~/.bashrc
You can see that by executing the NVM list
Common NVM commands
NVM list or NVM ls Displays the installed version of the node
NVM install 6.9.0 Installs a node version 6.9.0
NVM use 6.9.0 uses this version of Node 6.9.0
NVM uninstall 6.9.0 Deletes node 6.9.0
NVM ls-remote Lists the remote node versions
NVM current Displays the node version in use
NVM Alias Default v4.3.0 Change v.4.3.0 to the default version. The default version is displayed each time you create a command line
NPM list –depth=0 -g