1巩梢、安裝brew:curl -LsSf http://github.com/mxcl/homebrew/tarball/master | sudo tar xvz -C/usr/local --strip1
2创泄、brew update
3艺玲、brew install nvm,在shell的配置文件(~/.bashrc, ~/.profile, or ~/.zshrc)中添加如下內(nèi)容:
? ? ? ? ? ? # For NVM
? ? ? ? ? ? ?export NVM_DIR=~/.nvm
? ? ? ? ? ? ? source $(brew --prefix nvm)/nvm.sh
4括蝠、查看node的所有版本:nvm ls-remote
5、選擇版本安裝:nvm install 版本號(hào)
6饭聚、查看已經(jīng)安裝的版本:nvm ls
7忌警、使用哪個(gè)版本:nvm use 版本號(hào)