How to install nvm (Node Version Manager)  in MAC

  • Download nvm.
curl -o- | bash
  • Get ready your terminal to conside nvm command. Open zshrc file by running the following command:
nano ~/.zshrc
  • Paste the following code there:
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/" ] && \. "$NVM_DIR/"  # This loads nvm
[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"  # This loads nvm bash_completion
  • Hit CTRL+O, CTRL + return to save the file.
  • Restart the Terminal.
  • You will be able to use nvm package now.
  • Verify the nvm installation by running the following command:
command -v nvm
  • The output should nvm in return