How can you fix brew command not found error message?
Brew is a powerful package manager for MacOS that lets you install and manage software packages from a variety of sources. However, if you encounter the “brew command not found” error, it can be frustrating and difficult to fix. In this article, we’ll show you how to fix brew command not found error and get your MacOS software installation up and running again.
Solution 1: Install Brew on Mac to fix brew command not found
There are a few different ways to fix the “brew command not found” error. The most common way is to reinstall Brew.
To do this, open a Terminal window and type the following command:/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
Press Enter and follow the on-screen instructions to install Brew.
Solution 2: Add Brew to PATH Mac M1
If reinstalling Brew doesn’t fix the “brew command not found” error, you can try the following workaround:
- Open a terminal window and type “
nano ~/.zshrc
“. This will open the zshrc configuration file. - If the location is not in your PATH environment variable, you will need to add it. To do this, add the following line:
export PATH="/opt/homebrew/bin:${PATH}"
- Save the file by pressing
CTRL + O
and then pressReturn
to close it. - Type “
source ~/.zshrc
- Type
brew doctor
- Try running Brew again.
What is Brew?
Brew is a package manager for macOS that allows you to manage your software installations from a single terminal command. Brew allows you to install, update, and uninstall software on your Mac with ease. Brew can also install software that is not available in the Mac App Store.
Also Read : How to install C/C++ Compiler in Mac OS M1 Big Sur