achaodeMacBook-Pro:~ achao$ brew info nvm ==> nvm: stable 0.39.3 (bottled), HEAD Manage multiple Node.js versions https://github.com/nvm-sh/nvm /opt/homebrew/Cellar/nvm/0.39.3 (9 files, 190.6KB) * Poured from bottle using the formulae.brew.sh API on 2023-06-26 at 13:22:48 From: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/nvm.rb License: MIT ==> Options --HEAD Install HEAD version ==> Caveats Please note that upstream has asked us to make explicit managing nvm via Homebrew is unsupported by them and you should check any problems against the standard nvm install method prior to reporting.
You should create NVM's working directory if it doesn't exist: mkdir ~/.nvm
Add 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_completion
You can set$NVM_DIR to any location, but leaving it unchanged from /usr/local/Cellar/nvm/0.39.3 will destroy any nvm-installed Node installations upon upgrade/reinstall.