NVM在MAC的安裝

in #nvm7 years ago (edited)
NVM是 ( Node Version Manager

Node的版本管控,可以透過NVM來傻瓜的切換當前運行的Node版本,好配合開發過程中要進行的檢驗。好比我的車庫中有上百台車(即Node版本的比喻),NVM則是不同車的車鑰匙。NVM下指令可以換不同把車鑰匙,再拿鑰匙牽車去兜風

在MAC上面,至少有兩種方式可以安裝NVM

  • 使用Homebrew安裝
  • 使用cURL下載並執行NVM提供的安裝Script

NVM是Command方式操作,沒有UI介面。那麼,NVM安裝完後,就還牽扯一個問題,也就是「環境變數」的問題。不設定好的話,我們就只能在安裝NVM的檔案夾下面執行NVM指令。設定好的話,在任意的目錄下,都可以呼叫的到喔。

偏偏我用的Fish Shell(有高亮語法),在使用Homebrew安裝後,發現設定 .bash_profile 沒有那麼順利,搞了半天。後來改執行NVM提供的安裝腳本Script,腳本幫忙傻瓜註冊 (~/.bash_profile, ~/.zshrc, ~/.profile, or ~/.bashrc)這幾個環境變數的檔案中,才成功。

成功的意思是,不僅安裝完成,且可以在任意的目錄執行NVM指令了。接下來,讓我們帶著車鑰匙出發吧

Sort:  

Congratulations @ian8ko! You received a personal award!

Happy Birthday! - You are on the Steem blockchain for 1 year!

Click here to view your Board

Support SteemitBoard's project! Vote for its witness and get one more award!

Congratulations @ian8ko! You received a personal award!

Happy Birthday! - You are on the Steem blockchain for 2 years!

You can view your badges on your Steem Board and compare to others on the Steem Ranking

Vote for @Steemitboard as a witness to get one more award and increased upvotes!

Coin Marketplace

STEEM 0.17
TRX 0.15
JST 0.028
BTC 60157.20
ETH 2416.98
USDT 1.00
SBD 2.43