Install Homebrew (brew install) on macOS 12 Monterey(What to do when 「command not found: brew」 error is displayed)
Go simple.
If you have an older version, remove it.
Open terminal and run
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/uninstall)"
After uninstalling, run this to install
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
Check if it is installed properly
brew -v
If no version information is displayed and you see the following message
command not found: brew
You have to export the path. Enter the following command.
export PATH="/opt/homebrew/bin:$PATH"
Finally this
echo 'export PATH="/opt/homebrew/bin:$PATH"' >> $HOME/.zshrc
That’s it!