Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

After installing Homebrew I get `zsh: command not found: brew`

➜  ~ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" -e:77: warning: Insecure world writable dir /usr/local/bin in PATH, mode 040677 It appears Homebrew is already installed. If your intent is to reinstall you should do the following before running this installer again:     ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall)" The current contents of /usr/local are bin CODEOFCONDUCT.md etc git lib Library LICENSE.txt munki README.md sbin share .git .github .gitignore ➜  ~ brew install maven zsh: command not found: brew 
like image 472
Elad Benda2 Avatar asked Apr 15 '16 21:04

Elad Benda2


People also ask

Does Homebrew work on zsh?

If the zsh shell that Apple provides in Mac OS X is out of date, as it has been in Yosemite and El Capitan, it's trivial to install the latest version, available on homebrew . Here's a couple of steps you need to do to make that your default. Read on, for how to do it.

Why is brew not found on Mac?

Why Do I Get 'brew: command not found?” As mentioned above, one of the common reasons for getting the 'command not found brew' on Mac is due to the executable brew directory not being present in the 'PATH' environment.


1 Answers

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.

like image 95
Spindizzy Avatar answered Sep 28 '22 13:09

Spindizzy