24

I can not install any brew packages on my mac with the following error info.

Installed on my Mac:

  • macOS 10.14 Beta (18A293u)
  • Xcode 9.3 (9E145)
  • Xcode 10.0 beta (10L176w)

Type in brew install xxx. The output is:

Error: Your Xcode (9.3) is too outdated.
Please update to Xcode 10.0 (or delete it).
Xcode can be updated from
https://developer.apple.com/download/more/

Error: Xcode alone is not sufficient on Mojave.
Install the Command Line Tools:
xcode-select --install

But as I type in xcode-select --install, it says it is not available
Xcode select install error

Paths of two versions of Xcode on my Mac:

/Applications/Xcode-beta.app
/Applications/Xcode.app

And my config output:
xcode-select -p

/Applications/Xcode.app/Contents/Developer     

brew config

HOMEBREW_VERSION: 1.6.7
ORIGIN: https://github.com/Homebrew/brew
HEAD: 22e9fd772926e389e264cfb328c3d810b06759f9
Last commit: 5 days ago
Core tap ORIGIN: https://github.com/Homebrew/homebrew-core
Core tap HEAD: 854bb90b366169915849fc9a83e941b8883cea1f
Core tap last commit: 6 hours ago
HOMEBREW_PREFIX: /usr/local
CPU: octa-core 64-bit haswell
Homebrew Ruby: 2.3.6 =>./System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/bin/ruby
Clang: 9.1 build 902
Git: 2.15.1 => /Applications/Xcode.app/Contents/Developer/usr/bin/git
Curl: 7.54.0 => /usr/bin/curl
Java: 1.8.0_131
macOS: 10.14-x86_64
CLT: N/A
Xcode: 9.3
XQuartz: N/A
2
  • 2
    Upvoted because so well asked, but also voted to close because this should have been asked on AskDifferent or SuperUser.
    – matt
    Jun 10, 2018 at 3:03
  • Had this same issue earlier today. Resolved by downloading CL Tools from developer.apple.com, and running both CLTools_SDK and CLTools_Executables. Jun 10, 2018 at 15:16

7 Answers 7

24

You will need to install both "Xcode 10.0 Beta" from https://developer.apple.com/download/ AND "Command Line Tools (macOS 10.14) for Xcode 10 Beta" from

https://download.developer.apple.com/Developer_Tools/Command_Line_Tools_macOS_10.14_for_Xcode_10/Command_Line_Tools_macOS_10.14_for_Xcode_10.dmg

Update contributed by other comments, after you installed "Command Line Tools", you will also need to execute the following command in your terminal.

open /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg
1
  • I am using Xcode 10.0 beta 3 (on macOS 10.14) and there is no command line tools available for beta 3 version.
    – CopsOnRoad
    Jul 20, 2018 at 16:48
20

Beginning in 10.14, a new step is required to create the header files in /usr/include:

Install /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg

Source: The Xcode 10 release notes

1
  • That's it. Cheers Jul 5, 2018 at 11:06
9

After installing CLT, you can ask CLT to add header files to /usr/include, then homebrew will appropriate detect the Command Line Tools.

installer -pkg /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg -target /
3

After installing Xcode 10 Beta and Command Line Tools (macOS 10.14) for Xcode 10 Beta, I also changed the path for xcode-select to use the newly installed command line tools with:

sudo xcode-select -s /Applications/Xcode-beta.app/Contents/Developer     
1

At this time, Brew is not supporting macOS Mojave Beta.

(Type brew doctor to confirm that they are not accepting issues for Mojave yet)

See: https://apple.stackexchange.com/questions/327458/install-homebrew-packages-on-macos-mojave-beta

See: https://github.com/Homebrew/brew/issues/4295

0

I was able to install Homebrew on Mojave by manually downloading the command line tools here: https://developer.apple.com/download/more/

Modify the Homebrew install script here: https://raw.githubusercontent.com/Homebrew/install/master/install

By replacing:

def should_install_command_line_tools?
  return false if force_curl?
  return false if macos_version < "10.9"
  !File.exist?("/Library/Developer/CommandLineTools/usr/bin/git") ||
  !File.exist?("/usr/include/iconv.h")
end

With this:

def should_install_command_line_tools?
  return true
end

Then just execute the script.

This is a little hacky, but it worked for me and could help someone out in the beta period.

3
  • I did not try the hacking way, but installing CLTools works.Thanks very much. Unfortunately, I still failed in installing my brew package, like brew install octave. It says Error: You are using macOS 10.14. We do not provide support for this pre-release version. You may encounter build failures or other breakages. Please create pull-requests instead of filing issues.
    – Weslie
    Jun 13, 2018 at 3:15
  • This answer pointed me in the correct direction, but, having manually installed Xcode Beta 2 and the associated command line tools, I updated the code block above to return false NOT return true (you've already installed command line tools, so brew should not). I was then able to install homebrew as expected and installing packages with brew is also working correctly
    – Erve1879
    Jun 28, 2018 at 6:31
  • You can avoid modifying the script by installing /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14. pkg
    – craig65535
    Jul 5, 2018 at 0:23
-1

confirm that Command Line Tools for 10.14 won't create /usr/include/ folder that makes brew install script insist to re-download and install CL.

download the script, and manual removing checking works fine. (be aware it should be false instead of true.

def should_install_command_line_tools?
  return **false**
end
2
  • You can create the headers in /usr/include by installing /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14. pkg
    – craig65535
    Jul 5, 2018 at 0:19
  • yes we also found the same solution yesterday. thanks @craig65535
    – Irvin Chen
    Jul 6, 2018 at 3:05

Your Answer

Reminder: Answers generated by Artificial Intelligence tools are not allowed on Stack Overflow. Learn more

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.