zsh: command not found: brew
Updated August 29, 2026
zsh: command not found: brew usually means Homebrew is installed but its shell environment has not been loaded, or it is not installed yet.
command -v brew
ls -l /opt/homebrew/bin/brew /usr/local/bin/brew 2>/dev/null
The usual prefix is /opt/homebrew on Apple silicon and /usr/local on Intel Macs. Use the shell setup command printed by the current Homebrew installer; for an existing installation it commonly looks like this on Apple silicon:
eval "$(/opt/homebrew/bin/brew shellenv)"
Put the equivalent command in ~/.zprofile if it fixes the problem, then open a new terminal and run brew --version. Avoid adding both prefixes blindly: that can make zsh select a different installation from the one you intended. If brew is absent from both locations, install it only from brew.sh and read the installer output before accepting its shell changes.
Sources
related.
Ruslan Osipov
About the author