do you have the command line tools for Xcode installed?

Homebrew macOS Requirements

  • A 64-bit Intel CPU or Apple Silicon CPU 1
  • macOS Mojave (10.14) (or higher) 2
  • Command Line Tools (CLT) for Xcode: xcode-select --install, developer.apple.com/downloads or Xcode 3
  • A Bourne-compatible shell for installation (e.g. bash or zsh) 4

eidt: searching for the error led me to this github comment from yesterday

it suggests running these commands for a fix

rm -fr $(brew --repo homebrew/core)
brew tap homebrew/core