目录
[Mac 安装nvm](#Mac 安装nvm)
[Mac(M1) 安装nvm](#Mac(M1) 安装nvm)
Mac 安装nvm
下载命令
brew install nvm
配置环境变量
vi ~/.zshrc
内容如下:
export NVM_DIR="$HOME/.nvm"
[ -s "/usr/local/opt/nvm/nvm.sh" ] && \. "/usr/local/opt/nvm/nvm.sh" # This loads nvm
[ -s "/usr/local/opt/nvm/etc/bash_completion.d/nvm" ] && \. "/usr/local/opt/nvm/etc/bash_completion.d/nvm" # This loads nvm bash_completion
刷新
source ~/.zshrc
Mac(M1) 安装nvm
搜索
brew search nvm
下载
brew install nvm
为nvm创建文件夹
mkdir ~/.nvm
配置环境变量
vi ~/.zshrc
内容如下:
export NVM_DIR=~/.nvm
source $(brew --prefix nvm)/nvm.sh
刷新
source ~/.zshrc