

Run the following command: $ brew install you need to unlink the currently installed Node.js version: $ brew unlink nodeįinally, you need to link the newly installed version of Node.js: $ brew link -force

Let us say you want to downgrade Node.js from version 14 to 12. To upgrade all packages, run the upgrade command without specifying any package name, as shown below: $ brew upgradeĭowngrading a package is a little tricky with Homebrew.įirst of all, you need to use the search command to find the lower version of the package that you want to downgrade: $ brew search node To upgrade an already installed package (formula), just execute the following command: $ brew upgrade

Homebrew also provides an online package browser to browse all the available packages for macOS and Linux. To install new formula, you use the following command: $ brew install įor example, to install the Node.js default version with Homebrew, you execute the following command: $ brew install node Installing PackagesĮach package in Homebrew is called a formula. Make sure you update Homebrew before installing or updating any software. To update Homebrew to its latest version, run the following command in your terminal: $ brew update Follow the instructions printed on the screen to finish the installation. The above command executes the installer script provided by the Homebrew team. Now you can install Homebrew with the following command: $ ruby -e " $( curl -fsSL )" Xcode is not required to use Homebrew, but some other packages will need Xcode's command-line tools.Įxecute the following command in your terminal to install Xcode's command-line tools package: $ xcode-select -installįollow the instructions on the screen to complete the installation of Xcode's command-line tools. bash or zsh) Installing Homebrewīefore we install Homebrew, you need to install Xcode's command-line tools package. A Bourne-compatible shell for installation (e.g.Command Line Tools (CLT) for Xcode or Xcode ( click here to download).Get Started With Python on Mac: A Step-by-Step Guide to Running Python Files in Terminal Prerequisites
