(0) Jane said
currently has
n
and the
nvm
These two tools can be upgraded to node, the following is a brief introduction to the use of both.
(1) n
Installation is simple:
$ sudo npm install-g n
Another way to get the source code installation:
$ git clone https:///github.com/visionmedia/n.git$ cd n$ [sudo] make install
After the installation is complete, direct input n
after the output of the currently installed node version and the version you are using (there is one o
), you can move up and down ARROW keys to select the version to use, and finally press ENTER to take effect.
$ n 0.10.1 0.10.15 o 0.10.21 0.11.8
If you want to install a different version (such as 0.11.12), then the following:
$ n 0.11.120.11.12 /usr/local/n/versions/0.11.12 fetch:http:// nodejs.org/dist/v0.11.12/node-v0.11.12-darwin-x64.tar.gz# 6%
Install the latest version
$ n Latest
Installing a stable version
$ n Stable
Delete a version
Executes the script in the specified version
$ n Use 0.10.21 some.js
Nvm
Node Version Manager, which differs from its n
implementation, is implemented through shell scripting.
There are two ways of installing:
$ curl https:///raw.github.com/creationix/nvm/v0.4.0/install.sh | sh
Or
$ WGET-QO-HTTPS://raw.github.com/creationix/nvm/v0.4.0/install.sh | sh
The above script will nvm
clone the library to ~/.nvm
, and then ~/.bash_profile
add the source at, or at the end, ~/.zshrc
`~/.profile
after installation, you can install node with the following command
$ NVM Install 0.10
Use the specified version
$ NVM Use 0.10
To view the version that is currently installed
$ nvm LS.NVM- v0.10.24
View the version you are using
$ nvm currentv0. 10.24
Execute script with the specified version
$ NVM Run 0.10.24 myapp.js
Uninstalling NVM
$ RM-RF ~/.NVM
Reference
- Https://github.com/creationix/nvm
- https://github.com/visionmedia/n
MAC node version management