Homebrew error on Mojave

➜ ~ brew upgrade imagemagick
Updating Homebrew…
==> Auto-updated Homebrew!
Updated 1 tap (homebrew/cask).
No changes to formulae.
==> Upgrading 1 outdated package, with result:
imagemagick 7.0.8–0 -> 7.0.8–6
==> Upgrading imagemagick
Error: The Command Line Tools header package must be installed on Mojave.
The installer is located at:
/Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg

Solution
Install .pkg file which the Terminal mentioned manually

$ cd /Library/Developer/CommandLineTools/Packages/
$ open .

Then, click “macOS_SDK_headers_for_macOS_10.14.pkg”.

This step will take a couple of minutes. Then you can start using brew upgrade command.

Written by

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store