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