macOS: zsh: command not found: brew (Homebrew not on PATH on Apple Silicon)
Homebrew is installed in /opt/homebrew on Apple Silicon Macs, which isn’t on PATH until you add its shellenv line.
Seen on:
macOS
Meaning
The installer prints “Next steps” to add brew to ~/.zprofile; skipping it (or using bash/fish) leaves brew and installed tools unavailable. Intel Macs use /usr/local.
Common causes
- Homebrew installed but shellenv not added to ~/.zprofile
- New terminal/shell not reloaded
- Homebrew not installed at all
⚡ Quick fix
- Add eval "$(/opt/homebrew/bin/brew shellenv)" to ~/.zprofile
- Open a new terminal (or source the file)
- Install Homebrew if /opt/homebrew/bin/brew doesn’t exist
Detailed fix by platform
Shell
- bash
echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> ~/.zprofile eval "$(/opt/homebrew/bin/brew shellenv)" brew --version
How to diagnose
- Path — ls /opt/homebrew/bin/brew
- Shell — echo $SHELL and profile file
🔧 Still not fixed?
Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:
Similar errors
Other ways to find it
🧠 Still stuck? Analyze your error
Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.
Was this page helpful?
Report a correction or suggest an improvement
Last updated 7 Oct 2026