Skip to content
MappleCare Community ↗

MappleCare Community

[Solved] Homebrew Command Not Found & PATH Collision on Apple Silicon on Mac mini M4: How to resolve Shell startup files invoking obsolete Intel /usr/local/bin before native /opt/homebrew/bin

Find answers from other Apple users or start a discussion about your device.

All Forum Rooms

Home › Forums › Apple Silicon, Terminal & Developer Tools › [Solved] Homebrew Command Not Found & PATH Collision on Apple Silicon on Mac mini M4: How to resolve Shell startup files invoking obsolete Intel /usr/local/bin before native /opt/homebrew/bin

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #20451
    Willie Wells
    Community Contributor
    Diagnostic Hardware Specs: Mac mini M4 (16GB) | OS Version: macOS Sonoma 14.7 | Archive Source: Apple Support Community #256729675

    I am running into a persistent issue on my Mac mini M4 (16GB) running macOS Sonoma 14.7.
    Whenever the machine encounters Shell startup files invoking obsolete Intel /usr/local/bin before native /opt/homebrew/bin, the following diagnostic log appears in Console:

    zsh: command not found: brew (architecture mismatch: invoking x86_64 homebrew under arm64 zsh session)

    I verified that hardware connections are intact and tested across different power sources. What is the verified diagnostic procedure to permanently eliminate this symptom?

    Mac mini M4 (16GB) Home Server | Apple TV 4K | Eve Energy Thread Mesh | Edinburgh, UK
    Smart Home & Matter/Thread Integrator | "Verified Apple Discussions Archive"
    #20452
    Lisa Vargas
    Community Contributor
    Apple Recommended / Verified Community Solution
    This canonical solution was verified and marked as solved in the Apple Support Community archive.

    Injecting official Apple Silicon Homebrew environment evaluation into ~/.zprofile.

    Here is the exact step-by-step diagnostic and remediation procedure verified by Apple Certified Support Professionals:

    1. Add native ARM64 prefix to profile:
      echo 'eval "$(/opt/homebrew/bin/brew shellenv)"' >> ~/.zprofile
      eval "$(/opt/homebrew/bin/brew shellenv)"
    2. Verify native execution:
      which brew
      file $(which brew) # must output: Mach-O 64-bit executable arm64
    3. Run diagnosis:
      brew doctor

    Following this procedure restores full stability with zero recurring log errors.

    Mac mini M4 (24GB) | PreSonus Quantum HD 8 | Audio-Technica ATH-R70x | Milan, IT
    Apple Certified Support Professional (ACSP) | Classical Pianist & Spatial Audio Arranger
Viewing 2 posts - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.