NVM is a shell script that allows you to easily install & manage NodeJS. In this article, we will look at how to install NVM on Mac with Homebrew utility. If you have not installed Homebrew on your Mac, you can easily do so by opening the terminal and running the following command. It will download & install homebrew for you.
NVM configuration. The article bellow depends of your shell installation / configuration. From the MacOS Catalina, ZSH is used by default. Click here for more information. Execute the following commands according your shell: nano /.bashprofile # If you use bach nano /.zprofile # If you use ZSH. Add the following lines in file. Mac users only assuming you installed nvm prior, and npm correctly (step-by-step guide below on how to install it: install nvm for Mac users). You need to: Find the '.zshrc' file. Hackintosh macOS Catalina - Post Installation Support. I have a hp probook 450 g6 i7 whiskey lake 16gb ram and 600gb nvm hard drive and it’s still not populating. NVM(Node Version Manager) 맥OS에서 설치 & 사용하기. GitHub Gist: instantly share code, notes, and snippets.
Here are the steps to install NVM on Mac with Homebrew.
If you have already installed NodeJS earlier, then open terminal and run the following commands to uninstall them first. If there is no NodeJS installed on your system, you can skip this step.
Run the following command to update NVM package list and install NVM.
Create directory for NVM in /home.
Next, we need to configure environment variables to point to NVM. Open bash_profile file in text editor. Alternatively, you may open ~/.zshrc for macOS Catalina or later.
Add the following lines to this file.
Save and close the file by typing Esc, then entering :wq.
Run the following command to reload bash_profile. It will also ensure that environment variable is updated every time you login.
NVM is a very handy tool to install & manage NodeJS on your system. You can list the available NodeJS versions with the following command.
Next, if you want to download and install the latest NodeJS version, just run the following command.
If you want to download & install a specific version of NodeJS like Node 12.x, run the following command.
After installation, you can verify it with the following command.
If you have multiple versions of NodeJS installed on your system, you can set the default version with the following command. Here is an example to use Node 12.x as default version.
You can always install different NodeJS versions on same system and manage them easily using NVM.
That’s it. In this article, we have learnt how to install and manage NodeJS using NVM, in Mac. Although you can install NodeJS separately, without NVM, it is advisable to NVM since it allows you to easily manage multiple versions of NodeJS, making it convenient to test and upgrade to new versions, or rollback to older versions, as you need.
Also read:
Shell Script to Start, Stop & Restart Tomcat Automatically
Shell Script to Backup MySQL Database
Htaccess Redirect If URL Contains String/Word
How to Change Root Password in Linux
How to Run Shell Script as Cron Job