when homebrew do not allow sudo command to be used for writing into directory.
sudo chown -R $(whoami) /usr/local/Frameworks
chmod u+w /usr/local/Frameworks
------------------------------------------------------------------------------------
https://donatstudios.com/MojaveMissingHeaderFiles
$ sudo installer -pkg /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg -target /
If you get an error about that file not existing, you probably simply don't have the Xcode command line tools installed which can be remedied simply as follows:
$ xcode-select --install