HomeMacRepair “brew command not discovered” on Mac with zsh

Repair “brew command not discovered” on Mac with zsh


Homebrew for Mac

If you happen to’re a Homebrew person who’s now experiencing a “zsh: command not discovered: brew” error message in zsh shell, you’re in all probability perplexed as to why the brew command line line device is not working.

The explanation you could be experiencing the command not discovered error for brew is as a result of the zsh shell is just not capable of finding the brew binary to execute for no matter motive, both as a result of one thing is awry along with your $PATH, or the Homebrew set up, or each. Thus, to repair the brew command not discovered error, we are going to carry out a collection of actions to reinstall Homebrew after which set the trail manually if issues proceed to fail.

Repair “zsh: brew: command not discovered” on Mac with zsh Shell

First, we’re going to reinstall Homebrew. Do that even when you have already put in Homebrew into Ventura or your present MacOS model, and whether or not your Mac is an M1/M2 or in any other case.

On the command line, enter the next precisely:

/bin/bash -c "$(curl -fsSL https://uncooked.githubusercontent.com/Homebrew/set up/HEAD/set up.sh)"

Hit enter and proceed with the Homebrew set up as standard.

When set up has full, try to make use of the ‘brew’ command once more, for instance to put in a brew bundle, replace, or take away a bundle.

If you happen to proceed to expertise the brew command not discovered error message, you possibly can resolve it by inserting brew in your zshrc $PATH. You possibly can examine your PATH or add a brand new PATH with the export command with the

echo "export PATH=/choose/homebrew/bin:$PATH" >> ~/.zshrc

Subsequent, sort the next to restore brew if wanted:

brew physician

The echo strategy could also be acquainted to you when you have beforehand set setting variables.

Experiencing ‘command not discovered’ After Putting in Oh-My-Zsh? Attempt This

Particular to many customers who solely expertise the brew command not discovered drawback after putting in the favored Oh-my-zsh bundle, you could strive manually including the next line to your .zshrc file:

eval $(/choose/homebrew/bin/brew shellenv)

You can too add this to your zshrc with a single command:

echo "eval $(/choose/homebrew/bin/brew shellenv)" >> ~/.zshrc

Once more, strive operating brew physician afterwards.

If you happen to run the next brew command, you’ll even be given an answer of utilizing the identical string within the .zprofile:
brew assist shellenv

brew assist shellenv
Utilization: brew shellenv

Print export statements. When run in a shell, this set up of Homebrew will
be added to your PATH, MANPATH, and INFOPATH.

The variables HOMEBREW_PREFIX, HOMEBREW_CELLAR and HOMEBREW_REPOSITORY are
additionally exported to keep away from querying them a number of occasions. To assist assure
idempotence, this command produces no output when Homebrew’s bin and sbin
directories are first and second respectively in your PATH. Think about including
analysis of this command’s output to your dotfiles (e.g. ~/.profile,
~/.bash_profile, or ~/.zprofile) with: eval “$(brew shellenv)”

With the Homebrew path set (or the shellenv strategy to set needed environmental variables), the brew command will work as anticipated once more. If you happen to’re curious the place Homebrew packages are put in and saved within the file system

Did this trick work to resolve the “brew command not discovered” error message for you? Did you discover one other answer? Tell us your experiences within the feedback.



RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments