Set up Brew on M1 Mac

How to install brew on M1 Mac

Zack Hoherchak
Subjective Developer

--

Brew
Photo by Elevate on Unsplash

Installing Brew on your Mac is important because it helps you install other things! Start by running the command below (also found on the brew homepage)

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

Brew is now installed! Great, but how do we use it?

zsh: command not found: brew

Now we have to add brew to our path. If you have not added anything to your path yet, you will have to create a .zprofile or .zshrc file. Navigate to Users/your-name/ and look for .zprofile (you will have to “show hidden files”) which you can do by pressing CMD + Shift + . If you have one, great! If not create it, and add the path to the Brew bin folder. Brew landed in opt/homebrew/bin for me, so your .zprofile would look like this:

export PATH=/opt/homebrew/bin:$PATH
export PATH=/opt/homebrew/sbin:$PATH

Congrats, you can now brew! Most tools you install via Homebrew should now just work, although I have run into a few that install themselves in strange locations which means you will have to manually add them to your $PATH to get them to work. I’m guessing this is the next command you need 🧐

brew install git

--

--