Quick Links
If you see the “zsh: command not found: brew” error while using Homebrew, it most likely means the Terminal app can’t find the Homebrew executable. Don’t worry, though, because we’ll explore some potential solutions to fix this problem below.
1. Try Reinstalling Homebrew
Reinstalling Homebrew can remove any corrupted or outdated files and install a fresh copy of Homebrew. To remove Homebrew, you can follow these steps:
This will download and install the latest version of Homebrew. Once you restart the Terminal app, you should be able to use the brew command without any problems.

2. Add Brew to the PATH Environment Variable
There is a good chance that Homebrew could not be added to the PATH variable during installation, meaning your shell is unable to locate the Homebrew executable.
you’re able to fix this by manually adding Homebrew to your PATH via the Terminal. The command varies slightly depending onwhether your Mac has an Intel processor or an Apple silicon chip. Just copy and paste the appropriate command for your Mac into the Terminal app.

If you have a Mac with an Apple silicon chip, enter this command:
If your Mac has an Intel processor, enter this command instead:

you may check if Homebrew was successfully added to the PATH variable using the following command:
This will display all the executable binaries that Terminal can find. If Homebrew is present in the list, it means that Terminal is successfully able to locate the Homebrew executable.
3. Install Xcode Command Line Tools
Xcode Command Line Tools is a packagedeveloped and maintained by Apple that contains all the debuggers, compilers, and tools included with the entire Xcode IDE. Several users have reported that Homebrew cannot work without Xcode Command Line Tools installed. you’re able to install it by typing the following command into Terminal and hittingReturn:
After this, you can verify the installation using the following command:
If the installation was successful, you should get the following output after entering the command:
Homebrew offers several useful appsand is a must-have utility for every Mac power user. If you’re encountering the “zsh: command not found: brew” error, one of the troubleshooting steps we discussed above should resolve the problem and allow you to enjoy the best package manager available for macOS.