Brew 安装 nvm brew install nvm✔︎ JSON API formula_tap_migrations.jws.json [Downloaded 2.0KB/ 2.0KB]✔︎ JSON API cask_tap_migrations.jws.json [Downloaded 2.2KB/ 2.2KB]✔︎ JSON API cask.jws.json [Downloaded 18.7MB/ 18.7MB]✔︎ JSON API formula.jws.json [Downloaded 33.6MB/ 33.6MB]Fetching downloads for:nvm✔︎ Bottle nvm (0.40.6) [Downloaded 56.2KB/ 56.2KB]Pouring nvm-0.40.6.all.bottle.tar.gzCaveatsPlease note that upstream has asked us to make explicit managingnvm via Homebrew is unsupported by them and you should check anyproblems against the standard nvm install method prior to reporting.You should create NVMs working directory if it doesnt exist:mkdir ~/.nvmAdd the following to your shell profile e.g. ~/.profile or ~/.zshrc:export NVM_DIR$HOME/.nvm[ -s /opt/homebrew/opt/nvm/nvm.sh ] \. /opt/homebrew/opt/nvm/nvm.sh # This loads nvm[ -s /opt/homebrew/opt/nvm/etc/bash_completion.d/nvm ] \. /opt/homebrew/opt/nvm/etc/bash_completion.d/nvm # This loads nvm bash_completionYou can set $NVM_DIR to any location, but leaving it unchanged from/opt/homebrew/Cellar/nvm/0.40.6 will destroy any nvm-installed Node installationsupon upgrade/reinstall.Type nvm help for further information.Summary /opt/homebrew/Cellar/nvm/0.40.6: 10 files, 225.8KBRunning brew cleanup nvm...Disable this behaviour by setting HOMEBREW_NO_INSTALL_CLEANUP1.Hide these hints with HOMEBREW_NO_ENV_HINTS1 (see man brew).增加export NVM_DIR$HOME/.nvm[ -s /opt/homebrew/opt/nvm/nvm.sh ] \. /opt/homebrew/opt/nvm/nvm.sh # This loads nvm[ -s /opt/homebrew/opt/nvm/etc/bash_completion.d/nvm ] \. /opt/homebrew/opt/nvm/etc/bash_completion.d/nvm # This loads nvm bash_completion第一步vim ~/.zshrc第二步source ~/.zshrc查看版本 nvm -v0.40.6