

Installing the older versions of Node. This installs the latest version of Node.js. Now you're ready to install node via Homebrew: run brew install node. Test if Node.js is already installed somewhere else with node -v: if it gives you a version number, uninstall it by following these instructions. This updates Homebrew with a list of the latest version of Node. If not, go to the the website brew.sh and copy-paste the command given in your terminal to install it. Installation Steps Open the Terminal app and type brew update. First, check if Homebrew is installed with brew -v.

If you've not already done so, please make sure that Node.js is installed via Homebrew. Open up your terminal and type brew install node. After you have Linuxbrew installed, the whole process should only take you a few minutes. It handles downloading, unpacking, compiling, and installing Node and NPM on your system. In this tutorial I'll show you how to switch between multiple versions of Node.js on macOS with Homebrew.įirst we need to make sure that your environment is ready. Installing Node.js and NPM is pretty straightforward using Linuxbrew, the Linux port of Homebrew. But sometimes you'll need a different version of Node.js than the latest. It is also the best way to install Node.js and, with that, npm. Use NPM to Update Your Node Version To update Node with NPM, you will install the n package, which will be used to interactively manage node versions on your device.

Homebrew is an awesome tool for installing and managing packages installed on macOS.
