要安裝或更新nvm,應運行安裝腳本。爲此,你能夠手動下載並運行腳本,也能夠使用如下cURL或Wget命令:git
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.1/install.sh | bash
或者github
wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.1/install.sh | bash
其中v0.35.1
是版本號bash
最新版本:
https://github.com/nvm-sh/nvm#profile_snippetcurl
三種方法均可行,選擇其中一種,安裝成功,重啓終端。
輸入command -v nvm
輸出nvm
表明安裝和配置成功,能夠開始使用!
url
安裝成功後,若是在鍵入command -v nvm後獲得nvm: command not found
或終端沒有反饋,則只需關閉當前終端,打開一個新終端,而後嘗試再次進行驗證。spa
注意:在OS X上,若是在運行安裝腳本後nvm: command not found
,多是如下緣由之一:code
touch~/.bash_profile
建立一個並再次運行安裝腳本若是上述方法不能解決問題,能夠嘗試如下方法:blog
若是上述方法仍是沒有解決問題試試打開你的.bash_profile文件,添加下面這段代碼:ip
export NVM_DIR=~/.nvm source ~/.nvm/nvm.sh
輸入command -v nvm
輸出nvm
安裝和配置成功,能夠開始使用!get