New machine setup

Fix "zsh: command not found: brew"

Homebrew is installed but your terminal can't find it, usually on Apple silicon Macs. Add it to your PATH.

  1. Check Homebrew is installed
    Terminal
    ls /opt/homebrew/bin/brew /usr/local/bin/brew

    If neither file exists, install Homebrew first (see Set up a package manager).

  2. Add brew to your PATH (Apple silicon Macs)
    Terminal
    echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> ~/.zprofile
    eval "$(/opt/homebrew/bin/brew shellenv)"

    On an Intel Mac, use /usr/local/bin/brew in both lines instead.

Check it worked

  1. Check brew works
    Terminal
    brew --version

On Ubuntu, use apt instead of Homebrew. See Set up a package manager.

On Windows, use winget instead of Homebrew. See Set up a package manager.