NVM is similar to Python's virtualenv and Ruby's RVM.
The NVM (Node version manager,node multiple version manager) is a generic term that has many different implementations. Usually we say that NVM refers to HTTPS://GITHUB.COM/CREATIONIX/NVM or https://github.com/visionmedia/n. Both of these tools are written using the shell.
N
Personal feeling N is more concise, it has only one script file.
Installation
If you already have NPM installed, you can execute the command directly to install N:
$ npm install -g n
Or just get the source code installed:
$ git clone https://github.com/visionmedia/n.git$ cd n$ [sudo] make install
Use
Run the n command directly to see all installed versions.
$ n
Run command N to install the specified version of node. Version can be stable (the latest stable version), latest (the latest version), or a specific version number.
$ n stableinstall : v0.10.24mkdir : /usr/local/n/versions/0.10.24fetch : http://nodejs.org/dist/v0.10.24/node-v0.10.24-linux-x64.tar.gz
The specified version will be installed in the/usr/local/n/versions directory.
Run command n RM to delete the specified version of node that has been installed.
Run command n use to select node with the specified version.
NVM installation
$ git clone https://github.com/creationix/nvm.git ~/.nvm$ source ~/.nvm/nvm.sh
Use
To view the installed version:
$ nvm ls
To view the versions that can be installed:
$ nvm ls-remote
Install the specified version:
$ nvm install <version>
The specified version will be installed directly in the directory where the NVM program is located.
Delete the specified version:
$ nvm uninstall <version>
Use the selected version:
$ nvm use <version>
Use NVM for node multi-version management