Install NVM on Mac pits encountered

Source: Internet
Author: User
Tags git clone

I have already installed on the Mac on the NVM, today to help friends in his computer, because it is a new version, did not expect a bit of pit.

* * Be sure to refer to the official documentation

One, command-line installation

(Image from GitHub)

This means, whether you install or update NVM, just open the terminal, copy the code in the diagram, enter.

curl-o-https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash

So easy. So, where is the pit?

Generally, after the installation we will enter NVM-V to see if the installation is really good. Results... Unfortunately, it hints to:

Nvm:comman not Found

Can't use Ah, Meng. I ran a bunch of them on the internet and said I had to deal with the. bash_profile file, adding the following (or similar) to it:

SOURCE ~/. bashrcexport nvm_dir="$HOME/.nvm""$NVM _dir/ nvm.sh""$NVM _dir/nvm.sh  ""$NVM _dir/ Bash_completion""$NVM _dir/bash_completion"  # this loads NVM bash_completion

I tried it all over, or it was wrong. Finally, I thought of the official document again.

I saw it at the time, and I wrote it clearly and plainly, but I didn't understand what the run the install script meant .... Silly, I also English special eight

Translate, that is to say, your Mac is OS X system, Encounter command not found this kind of problem, try the following two kinds of methods. I tried, the second one was ineffective for me, and I said the first.

Very simple, then, you re-open the terminal, enter the touch ~/.bash_profile, and then re-execute the installation of NVM the script on the line, together is:

Touch ~/-o-https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash

Second, update NVM

I found that the new version of NVM seems to use a little ah, how to do, quickly update Bai ~

The first is to execute the script that installs the NVM above.

The second kind, with Git, I just installed, paste code (the latest version to the official website to view):

// because I didn't use git before, I executed these two lines of CD ~/git clone https://github.com/creationix/nvm.git. nvm  // Otherwise you can write this directly to CD ~/. Nvmgit checkout V0. 33.11

Install NVM on Mac pits encountered

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.