Home > Enterprise >  Why I can't install brew on macOS?
Why I can't install brew on macOS?

Time:12-30

I am trying to install brew on my co-worker's macOS. I have brew on my computer. Not sure why we are having problems to install it on his computer. I am following this turial.

When I run:

% brew doctor
zsh: command not found: brew

It says brew was not installed.

I already edited his path at .zshrc. However, I did not put the comment suggested on the tutorial. Not sure if it makes any difference:

@Michaels-MacBook-Air ~ % cat .zshrc
export PATH=/usr/local/bin:$PATH

This is on:

@Michaels-MacBook-Air ~ % pwd
/Users/michaels

In addition, I already executed:

/bin/bash install.sh

Which return the following warning:

Warning: /opt/homebrew/bin is not in your PATH.
 Instructions on how to configure your shell for Homebrew
 can be found in the 'Next steps' section below.

And I checked xcode-select is installed:

@Michaels-MacBook-Air ~ % xcode-select --version
xcode-select version 2396.

I am suspicious his PATH might be wrong:

@Michaels-MacBook-Air ~ % echo $PATH
/usr/local/bin:/usr/local/bin:/usr/local/bin:/System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Applications/Keybase.app/Contents/SharedSupport/bin

Is this problematic? If no, what else could be causing a problem?

CodePudding user response:

From the Homebrew documentation:

This script installs Homebrew to its default, supported, best prefix (/usr/local for macOS Intel, /opt/homebrew for Apple Silicon and /home/linuxbrew/.linuxbrew for Linux)

If your coworker has an M1 or M2 mac, you'll need to add /opt/homebrew/bin to PATH.

  • Related