MAC node version management

Source: Internet
Author: User
Tags install node

(0) Jane said

currently has nand the nvmThese 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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.