

You can always install different NodeJS versions on same system and manage them easily using NVM. Here is an example to use Node 12.x as default version. If you have multiple versions of NodeJS installed on your system, you can set the default version with the following command. $ nvm install 12Īfter installation, you can verify it with the following command. If you want to download & install a specific version of NodeJS like Node 12.x, run the following command. Next, if you want to download and install the latest NodeJS version, just run the following command. You can list the available NodeJS versions with the following command. NVM is a very handy tool to install & manage NodeJS on your system. It will also ensure that environment variable is updated every time you login. Run the following command to reload bash_profile. Save and close the file by typing Esc, then entering :wq. $ vim ~/.bash_profileĪdd the following lines to this file. Alternatively, you may open ~/.zshrc for macOS Catalina or later. Next, we need to configure environment variables to point to NVM. $ brew updateĬreate directory for NVM in /home. Run the following command to update NVM package list and install NVM. $ brew uninstall -ignore-dependencies node If there is no NodeJS installed on your system, you can skip this step. If you have already installed NodeJS earlier, then open terminal and run the following commands to uninstall them first. Here are the steps to install NVM on Mac with Homebrew. It will download & install homebrew for you. If you have not installed Homebrew on your Mac, you can easily do so by opening the terminal and running the following command. In this article, we will look at how to install NVM on Mac with Homebrew utility. NVM is a shell script that allows you to easily install & manage NodeJS.
