node的默認安裝方式
通過nvm安裝,node的安裝及維護升級都非常方便
【官方地址】(https://github.com/creationix/nvm)
zsh-nvm插件
zsh-nvm是基於zsh的nvm插件,安裝完後直接可以使用nvm命令
【官方鏈接】(https://github.com/lukechilds/zsh-nvm)
配置也非常簡單,這裏採取As an Oh My ZSH! custom plugin方案,感覺比較通用:
克隆代碼到本地目錄
git clone https://github.com/lukechilds/zsh-nvm ~/.oh-my-zsh/custom/plugins/zsh-nvm
修改.zshrc
plugin = (git zsh-nvm)
source $ZSH/oh-my-zsh.sh
- 重新source,大功告成
% source ~/.zshrc