macOS使用brew安装nvm

安装 #

brew install nvm

配置 #

配置 ~/.bash_profile

open -e ~/.bash_profile

# 添加
export NVM_DIR=~/.nvm 
source $(brew --prefix nvm)/nvm.sh

# 使配置文件生效
source ~/.bash_profile 

配置 ~/.zshrc

open -e ~/.zshrc

# 添加
export NVM_DIR=~/.nvm 
source $(brew --prefix nvm)/nvm.sh

# 使配置文件生效
source ~/.zshrc