How to Fix "nvm not found" Error in MacOS
-
When you install NVM using Homebrew, you still need to add the following lines to your shell configuration file (.bashrc, .zshrc, etc.)
export NVM_DIR="$HOME/.nvm" . "/usr/local/opt/nvm/nvm.sh"
If you are using the Bash shell, open the ~/.bashrc file in your favorite text editor, and add the following lines at the end of the file:
export NVM_DIR="$HOME/.nvm" . "/usr/local/opt/nvm/nvm.sh"
If you are using the Zsh shell, open the ~/.zshrc file in your favorite text editor, and add the following lines at the end of the file:
export NVM_DIR="$HOME/.nvm" . "/usr/local/opt/nvm/nvm.sh"
After adding the lines to the appropriate file, save it and close the editor. Then, restart your terminal or run the source command to load the changes:
source ~/.bashrc
source ~/.zshrc