Use Brew to install NVM on Mac to support multiple versions of Nodejs

Source: Internet
Author: User
Tags install node
Brew mode

If the machine does not have node installed, then the brew install nvm NVM is installed first.

Next you need to add the following in the shell's configuration file (~/.BASHRC, ~/.profile, or ~/.ZSHRC):

# for Nvmexport Nvm_dir=~/.nvmsource $ (Brew--prefix NVM)/nvm.sh

Note The order of the configuration in case the new terminal is opened and node cannot be found.

Restart the terminal, the command line can use NVM, using the nvm install <version> corresponding node version of the installation, when writing this article, I am using nvm install 0.10 , the installation version is v0.10.32. Use nvm use <version> , and then nvm alias default <version> make sure that there is a default version. Last use nvm ls view.

Brew Method Supplement

If you previously installed node through ' Brew Install node ', you need to delete the node that exists on the system first:

Brew Remove--force nodesudo rm-r/usr/local/lib/node_modulesbrew prunesudo rm-r/usr/local/include/node# Check if brew is normal bre W Doctor

Use Brew to install NVM on Mac to support multiple versions of Nodejs

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.