NVM for macOS in 2 minutes
Not a member? Read this article for free.
When you have an application based on the Node.js architecture, the ability to switch between different versions is essential to ensure compatibility with existing projects and to take advantage of the latest platform features. However, this task can become complicated on operating systems such as macOS, where version management is not natively integrated.
What is NVM?
NVM is a command-line tool that makes it easy to install and manage multiple versions of Node.js on a single system. However, its implementation on macOS presents particular challenges due to differences in environment and dependency management compared to other operating systems because it is not included in our operating system; so we will have to install Homebrew instead.
How do we install it?
Open a terminal and install Homebrew with the following command:
/bin/bash -c "$(curl -fsSL <https://raw.githubusercontent.com/Homebrew/install/master/install.sh>)"
Once Homebrew is installed, we will proceed with NVM:
brew install nvm
For NVM to be used we always have to include it in our ~/.bash_profile
or ~/.zshrc
file:
source $(brew --prefix…