Homebrew’s official installation guide uses different default installation prefixes for Apple Silicon and Intel Macs: /opt/homebrew and /usr/local. That means a PATH instruction copied for another Mac may not fit yours.
If Homebrew command not found appears, first confirm whether installation finished, then check your current shell and PATH. If the command works only in one terminal session, inspect the shell startup settings before reinstalling or changing permissions.
This guide is for students who have just installed Homebrew and cannot run brew, including beginners following Python or front-end courses.
It also helps remote Mac users tell a shell setup problem from a missing development tool.
First identify which failure you’re seeing
“Homebrew command not found” is a symptom, not a diagnosis. The terminal may not know where Homebrew is, the installation may have stopped before finishing, or Homebrew may run while a later command fails. Those situations need different checks.
Before changing anything, copy the complete error and note what you ran immediately before it appeared. If the installer was still running or showed an error, do not treat the final command as proof that Homebrew installed successfully. Check the installer’s final output and compare it with the expected setup.
Start with these checks in the terminal where the error occurs:
echo "$SHELL"
command -v brew
SHELL gives you a clue about your configured shell. command -v brew asks the current shell whether it can locate a command named brew. If the second command prints a path, Homebrew is discoverable in that terminal. If it prints nothing, or reports that the command cannot be found, you have not yet shown that Homebrew itself is missing.
When command -v brew returns a path, try:
brew --version
If that prints version information, the command is callable. If a course command then fails, read that command’s own error instead of assuming it is still a PATH problem. The Homebrew command reference documents brew commands and their behavior; the official troubleshooting guide provides a route for investigating Homebrew-specific failures.
A shell is the program that reads what you type and runs commands. Think of it as the person at a classroom desk who looks for a requested tool. PATH is that person’s search list: it tells the shell which folders to check. If Homebrew’s folder is missing from the list, the tool can exist on disk and still seem unavailable.
Why does Mac say brew is missing after installation?
The most common issue is a mismatch between where Homebrew was installed and where the current shell looks for commands. The installation guide’s default prefixes differ by processor architecture. Do not paste a setup line you found elsewhere until you have checked that it matches your Mac and the actual Homebrew location. Homebrew’s installation instructions explain the post-install shell setup and the relevant prefix choices.
Check your Mac’s architecture in Apple menu → About This Mac. Then look for the Homebrew executable at the matching default location:
ls -l /opt/homebrew/bin/brew
ls -l /usr/local/bin/brew
One of these checks may report that the file does not exist; that alone is not a reason to create folders or alter permissions. It helps establish whether Homebrew is present at the expected default location. If you used a non-default installation location, use the path shown during your installation instead.
Once you have confirmed the actual path, test its shell setup directly. For the standard Apple Silicon prefix, run:
eval "$(/opt/homebrew/bin/brew shellenv)"
For the standard Intel prefix, run:
eval "$(/usr/local/bin/brew shellenv)"
These commands ask Homebrew to provide shell environment settings and apply them to the current session. The paths are not interchangeable. If neither matches your installation, stop and check the installation output rather than guessing a path.
Use the result to choose your next check
| What you observe | What it suggests | Safer next check |
|---|---|---|
| The installer did not finish, or the expected executable is absent | Installation may be incomplete, or it may use a different location | Review the installer’s final output and follow the official installation guidance |
brew works after eval, then disappears in a new terminal |
The current session received the setting, but startup setup may not | Check the startup file for the shell you actually use |
brew works in the Mac Terminal but not in VS Code |
The editor may start a shell with different settings | Check the editor’s selected terminal profile and environment |
brew is found, but a command reports permission or dependency errors |
Command lookup may already be fixed | Follow the specific error through Homebrew’s troubleshooting guidance |
This comparison keeps you from repeating an installation when only the current shell’s search list needs attention. It also separates a missing command from a command that starts but cannot complete its work.
Step-by-step: make the fix persist safely
A change made with eval affects the current shell session. Closing that terminal ends the session, so a setting applied only there may not carry into a new window. To make Homebrew discoverable in future sessions, the appropriate shell startup file must load the setting when that shell starts.
A startup file is like a note the shell reads before beginning a lesson. The right file depends on which shell starts and how it starts. Do not add the same line to every configuration file “just in case”; that can make it harder to understand which setting is active.
Step one: identify the shell in the failing terminal
Run:
echo "$SHELL"
ps -p $$ -o comm=
The first command shows the configured shell path. The second can help identify the shell process for the current session. If you use an editor’s integrated terminal, run the checks there too: it may not start the same shell configuration as the Mac Terminal.
Step two: confirm where Homebrew is installed
Use the path shown by the installer if you still have it. Otherwise, check the standard prefixes described earlier. If you find brew, record its full path. If you find no executable in either location, do not add a shell line pointing to a nonexistent file.
Step three: apply the matching setup to the current session
Use the eval command for the confirmed installation path. Then run:
command -v brew
brew --version
If these now work, the shell could find Homebrew after its environment was updated. That result points toward a startup configuration issue if the command disappears after you close the terminal.
Step four: choose the startup file for your shell
For zsh, check the login-shell configuration commonly used for startup settings, such as ~/.zprofile. For bash, the file can depend on whether the shell is a login shell and how the terminal launches it. Check the shell’s startup behavior before choosing a file. The VS Code terminal profile documentation explains that terminal profiles control which shell the integrated terminal starts.
Open only the relevant file and check whether it already contains a Homebrew shellenv line. For example:
grep -n 'brew shellenv' ~/.zprofile
If your actual shell and startup behavior call for a different file, inspect that file instead. If an appropriate line already exists, do not add another copy without understanding why it is not being read.
Step five: add only the correct line, then reload
If the correct startup file does not contain the setting, add the line that matches the confirmed installation path. For example, the standard Apple Silicon setup line is:
eval "$(/opt/homebrew/bin/brew shellenv)"
The standard Intel setup line is:
eval "$(/usr/local/bin/brew shellenv)"
Use the relevant line only; do not include both by default. Save the file, then open a fresh terminal or reload the file you edited. For zsh, you can reload ~/.zprofile in the current session with:
source ~/.zprofile
Reloading is a check, not proof that the setting will work in every terminal. A fresh terminal provides a better test of whether the startup configuration is being read.
Step six: verify it after reopening
In the fresh terminal, run:
command -v brew
brew --version
The first command should return the path to the executable if the shell can find it. If it still fails, note the shell, the file you changed, and the complete output. Review the official installation and troubleshooting guidance before making further changes.
Why does Homebrew work in Terminal but not VS Code?
The two terminals may start different shell profiles or inherit different environment settings. VS Code’s terminal documentation covers environment behavior, which can help explain why an integrated terminal does not behave like the Mac Terminal.
First, open VS Code’s integrated terminal and run the same checks you used in the Mac Terminal:
echo "$SHELL"
command -v brew
If Homebrew works in the system terminal but not in VS Code, compare the shell shown in each place and check the selected VS Code terminal profile. If both report a matching shell but brew remains unavailable only in the editor, review how the editor was launched and whether its terminal receives the expected environment. Avoid copying shell settings into every file or changing project settings until you know which shell VS Code starts.
If VS Code finds brew but a course task still fails, check the exact command and the tool it tries to run. A Python environment, project dependency, or editor extension can have its own setup requirements. The Homebrew command being available does not mean every program installed through it is automatically configured for every project.
Decide whether to fix PATH, repair installation, or stop
- If
command -v brewreturns a path andbrew --versionworks: keep the installation; investigate which terminal or course command behaves differently. - If running the matching
shellenvcommand makesbrewwork: fix the appropriate startup file, then test in a fresh terminal. - If the expected executable is absent and the installer did not finish: return to the official installation steps before configuring PATH.
- If Homebrew is found but reports a permission, dependency, or other operational error: follow that error in the troubleshooting guide; do not treat it as a command lookup problem.
- If the Mac belongs to a school or another administrator: do not bypass device controls. Ask the administrator what software and configuration changes are permitted.
When should you reinstall instead of fixing the command lookup?
You usually do not need to reinstall just because the shell cannot find brew. First check whether the executable exists and whether applying the matching shellenv setup makes it callable. Reinstalling without diagnosing the issue can leave the same startup configuration problem in place.
Consider returning to the official installation process only when you have evidence that installation did not complete or the expected files are missing, and you have ruled out a non-default installation location. If the command is found but Homebrew reports an error, use the official FAQ to identify the relevant issue. Read the exact message; do not replace it with a generic “PATH problem” label.
Treat permission errors as a different problem
A “permission denied” message is not the same as “command not found.” The first indicates that a command or file was located but an operation was refused. The second means the shell did not locate a command by that name. Homebrew’s official troubleshooting guidance is the appropriate reference for Homebrew errors and repair boundaries.
Do not run sudo to force changes to protected directories, recursively change ownership or permissions, disable security protections, or paste a repair script from an unknown source. These actions can create wider system problems and may violate school device rules. Instead, preserve the full error, note which command produced it, and follow the relevant official instructions. If the Mac is managed, get approval before changing system or developer settings.
Confirm the fix with a course task
A successful brew --version shows that the command can run; it does not prove that your course’s tools are ready. Reopen the terminal, confirm that command -v brew still returns a path, and run a simple command the course actually needs. If the course asks you to check an installed tool, use that exact check rather than installing extra packages just to test the setup.
If the command still fails, record the active shell, the complete error, the path you checked, and whether the problem occurs in the system terminal, VS Code, or both. Those details make the next troubleshooting step specific instead of guesswork. For remote Mac study, also distinguish a shell configuration issue from a course tool that is not installed or supported in the environment. KVMFLUX’s remote Mac use cases can help you assess whether your learning task actually needs a Mac environment.
Homebrew errors do not automatically mean you need a different computer. If the official checks show that your shell configuration is wrong, fix that first. If you still cannot complete the course setup, review the course’s Mac requirements and the available local options. A local Mac avoids dependence on a remote connection, while a remote environment may not suit long-term heavy work or tasks that require direct access to physical hardware. A school computer can also remain the better choice when it already provides the tools you need and permits their use.
If you lack a usable Mac, your school device blocks required setup, or you need a temporary environment for a course project, renting a Mac through KVMFLUX may be more suitable than buying hardware before you know you need it. Check the available plans against the course duration and required tools first; if your existing Mac works after correcting its shell settings, there is no reason to rent another environment just for a missing PATH entry.
Set Up Homebrew on Your Own Remote Mac
Rent a dedicated Mac mini M4 and verify your shell setup on real Apple hardware. Connect over SSH to work in Terminal or use VNC for a full macOS desktop. Choose a daily, weekly, monthly, or quarterly rental to match your learning or development schedule. Start your Mac in minutes without buying or maintaining hardware.