1

I was installing homebrew through the .pkg to install GNU Emacs, and it did not run after installation. I ran brew help and it outputted zsh: command not found: brew. Command Line Developer Tools were installed before installation of homebrew. The PKG file was from the official site. I am running MacOS 14.0 on a 2020 M1 MacBook Air. picture of the terminal window

1
  • You have not explained exactly all the steps you did for installation, so it's hard to diagnose. And of course: Die you manually check, whether the directory containing brew is in your PATH? Nov 15, 2023 at 14:46

1 Answer 1

1

Typically this is a problem with your $PATH - as there are some setup steps you have to run once the install completed.

Let's check to see if that's it... Run these commands:

/opt/homebrew/bin/brew update
/opt/homebrew/bin/brew update
/opt/homebrew/bin/brew doctor

If the doctor says to do things, do them and post a comment here. I am assuming you installed homebrew into the default location and missed this part of the install:

==> Next steps:

  • Run these two commands in your terminal to add Homebrew to your PATH:

    (echo; echo 'eval "$(/opt/homebrew/bin/brew shellenv)"') >> /Users/<whatever your obfuscated user path is>/.zprofile
    eval "$(/opt/homebrew/bin/brew shellenv)"

4
  • Output Please note that these warnings are just used to help the Homebrew maintainers with debugging if you file an issue. If everything you use Homebrew for is working fine: please don't worry or file an issue; just ignore this. Thanks! Warning: Homebrew's "bin" was not found in your PATH. Consider setting your PATH for example like so: echo 'export PATH="/opt/homebrew/bin:$PATH"' >> ~/.zshrc. Most likely, that is the case, although moving the path has been a recurring problem for me. Oct 25, 2023 at 18:18
  • Yes - see my edit - you need to append the results of (echo; echo 'eval "$(/opt/homebrew/bin/brew shellenv)"') to your .zprofile or back it up and start with a new .zprofile file...
    – bmike
    Oct 25, 2023 at 18:19
  • Are you using OhMyZsh or some other setup? @AverageTerminalUser
    – bmike
    Oct 25, 2023 at 18:20
  • 1
    No, I am using the default mac zsh, but your previous answer worked! brew help outputted the full help list, and all brew commands work! Oct 25, 2023 at 18:25

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .