Install NVM
Create a ~/.zshrc file (if it doesn't exist)
touch ~/.zshrc
Before proceeding to the next step I needed to manually install Rosetta 2 in order run apps not built for Apple silicon.
softwareupdate --install-rosetta
Install NVM using curl (found on the NVM Readme)
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash
This last command will update your
~/.zshrc
file to look like the following:export NVM_DIR="$HOME/.nvm" [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm [ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion" # This loads nvm bash_completion
Verify if NVM is installed. If it shows “nvm command not found”, then run the below command
source ~/.zshrc nvm list nvm -v
Verify & Install Node Using NVM [For specific version]
nvm run node --version
node -v
nvm install 16.13.0
node -v
Verify & Install NPM Using NVM [For specific version]
npm -v
npm install -g npm@8.1.1
npm -v
Uninstall a Node Version
nvm uninstall 12