CalcSnippets Search
macOS 1 min read

How to Fix Homebrew Command Not Found After Installing It on macOS Without Pretending the Shell Will Discover It by Telepathy

A practical guide to fixing Homebrew command not found on macOS by adding the correct shell initialization, checking Apple Silicon versus Intel install paths, and verifying that the current terminal session actually loaded the brew environment.

Why this issue is embarrassingly common: Homebrew often installs correctly. The shell just never got told where to find it.

Typical failure:

brew: command not found

Step 1: know the likely install path

On Apple Silicon Macs, Homebrew usually lives at:

/opt/homebrew/bin/brew

On Intel Macs, it is often:

/usr/local/bin/brew

Test both:

ls /opt/homebrew/bin/brew
ls /usr/local/bin/brew

Step 2: initialize the shell correctly

If Apple Silicon:

echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> ~/.zprofile
eval "$(/opt/homebrew/bin/brew shellenv)"

If Intel:

echo 'eval "$(/usr/local/bin/brew shellenv)"' >> ~/.zprofile
eval "$(/usr/local/bin/brew shellenv)"

Step 3: reload and verify

source ~/.zprofile
which brew
brew --version

If which brew still returns nothing, your shell config file may not be the one this terminal session loads.

Step 4: inspect PATH

echo $PATH

You should see either /opt/homebrew/bin or /usr/local/bin in the path depending on your machine.

Bottom line

When brew is not found after installation, it is usually a shell initialization problem, not a failed Homebrew install. Put the right brew shellenv line in the right profile and verify the active PATH.

Sources

Keep reading

Related guides