Install Nvm Mac Catalina

To install brew, visit and follow the instructions; Before installing anything with brew, it’s good practice to run brew update first. If your brew install is messed up, brew doctor can help restore a proper install. Using brew to install node. This command will install node using brew. Step 2 – Install NVM on macOS. Now, you system is ready for the installation. Update the Homebrew package list and install NVM. Brew update brew install nvm. Next, create a directory for NVM in home. Now, configure the required environment variables. Edit the following configuration file in your home directory.

As a developer, switch version of Node always for capable client?s demand or environment without review code again.

and nvm is one way of switch versions of node.

Please NEVER install it in this way (brew install).

Install Nvm Mac Catalina

If you did, I will show you how to clear and install it in the correct way step by step.

on Mac, from the beginning I launch terminal:

$ brew install nvm

then write an alias to terminal profile as

$ echo “source $(brew –prefix nvm)/nvm.sh” >> .bash_profile

Install Nvm Mac Catalina Update

my terminal is iTerm, zsh and on-my-zsh not bash so it is

$ echo “source $(brew –prefix nvm)/nvm.sh” >> .zhsrc

activate configuration :

$ ~/.bash_profile

to zsh:

$ . ~/.zshrc

NvmInstall Nvm Mac Catalina

then choose any version of node, like v6.5.0, just type

$ nvm install v6.5.0

then use this version of node

$ nvm use v6.5.0

it shows something wrong as below:

nvm is not compatible with the npm config “prefix” option: currently set to “/Users/fabian/.nvm/versions/node/v6.5.0” Run `nvm use – delete-prefix v6.5.0` to unset it.

After studying some feedback on GitHub. there is a correct way to install nvm.

First of all, remove node files controlled by nvm.

$ npm ls -g ? depth=0#check all module installed.$ sudo rm -rf /usr/local/lib/node_modules#delete node_modules folders$ sudo rm /usr/local/bin/node#delete node$ cd /usr/local/bin && ls -l | grep “../lib/node_modules/” | awk ?{print $9}?| xargs rm#delete global node module alias

restart terminal, then install nvm by curl

Best Way to install NVM is HERE ?

Install Nvm Mac Catalina

$ curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.32.1/install.sh | bash

The reason to happen the message seems brew doesn?t write the correct alias to terminal profile, it will happen something wrong if install nvm via brew on Mac.

Final Step:

You?ll find something added into .bash_profile, if you use zsh, add below line to ~/.zshrc

export NVM_DIR=”$HOME/.nvm”[ -s “$NVM_DIR/nvm.sh” ] && . “$NVM_DIR/nvm.sh” # This loads nvm

Install Nvm Mac Catalina Download

DONE!! Terminal Happy!

Install Nvm Mac Catalina Free

you may want to check the official document of NVM, here is the link:https://github.com/nvm-sh/nvm