Showing posts with label NPM. Show all posts
Showing posts with label NPM. Show all posts

Install NVM, NODE & NPM on MAC

 

Install NVM

  1. Create a ~/.zshrc file (if it doesn't exist)

    touch ~/.zshrc
  2. 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
  3. Install NVM using curl (found on the NVM Readme)

    curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash
  4. 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
  5. 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