After installing Homebrew I get `zsh: command not found: brew`
I had a similar issue on macOS Big Sur (11.0.1). In my case homebrew was saved in /opt/homebrew/
, and not in /usr/local/...
.
So I added
export PATH=/opt/homebrew/bin:$PATH
to .zshrc
file in my home directory, and the ZSH shell was able to find the brew command.
for this error zsh: command not found: brew
- Make sure you've installed Brew, with this (wait until its done installing) (Edit: added ending quote to the end)
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
- Then follow NEXT STEPS shown on command line, it should show something like this
==> Next steps:
- Add Homebrew to your PATH in /Users/$USER/.zprofile:
echo 'eval $(/opt/homebrew/bin/brew shellenv)' >> /Users/$USER/.zprofile
eval $(/opt/homebrew/bin/brew shellenv)
- Copy and paste the first line on the same terminal window, then hit enter
echo 'eval $(/opt/homebrew/bin/brew shellenv)' >> /Users/$USER/.zprofile
- Then Copy and paste the last line on the same terminal window, then hit enter
eval $(/opt/homebrew/bin/brew shellenv)
Finally you should be able to use brew help
and if that works, it means that brew was installed properly and running from ZSH
.
Homebrew has been installed on you computer. You need to modify your PATH like this:
export PATH=/usr/local/bin:$PATH
or execute brew
from its origin:
/usr/local/bin/brew install maven
Here are the steps I did...
1.Install homebrew
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
2.Run brew help
and see if it's working... If it showing an error "zsh: command not found: brew" follow along.
- Change the path to:
echo 'eval $(/opt/homebrew/bin/brew shellenv)' >> /Users/"YOUR USER NAME"/.zprofile
Remember to change the "USER NAME" with yours, Then type in:
eval $(/opt/homebrew/bin/brew shellenv)
Once successfully running these command type "brew help" to see if everything went ok.
I got the same issue after installing Homebrew in my MacBook (macOS Big Sur V 11.0.1).
After installation, in the console it says what should be done:
==> Next steps: - Add Homebrew to your PATH in /Users/USER/.zprofile: echo 'eval $(/opt/homebrew/bin/brew shellenv)' >> /Users/USER/.zprofile eval $(/opt/homebrew/bin/brew shellenv) - Run `brew help` to get started
Executing those two commands, in order, will add the brew command into the PATH:
echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> /Users/USER/.zprofile
eval "$(/opt/homebrew/bin/brew shellenv)"