xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance

See original GitHub issue

EDITED FOR PEOPLE JUST GETTING HERE

See https://github.com/nodejs/node-gyp/issues/569#issuecomment-255589932 and https://github.com/nodejs/node-gyp/issues/569#issuecomment-259421050, the warning can just be ignored. Command Line Tools works fine, you do not need the full Xcode.

See https://github.com/nodejs/node-gyp/blob/master/macOS_Catalina.md, here and here for more info.

Fix:

xcode-select --install # Install Command Line Tools if you haven't already.
sudo xcode-select --switch /Library/Developer/CommandLineTools # Enable command line tools

then just ignore the warning.

Alternatively if you want you can use the full Xcode.app (if you have it installed) with:

# Change the path if you installed Xcode somewhere else.
sudo xcode-select -s /Applications/Xcode.app/Contents/Developer

If your install is failing

There will be other errors nearer the end, almost certainly issues with the module you’re trying to install or a dependency. Please report the error to that project.

If that doesn’t work

Are you seeing this when you run node-gyp rebuild or npm install? If not then it’s nothing to do with node-gyp, raise a bug with the project you’re using.

Issue Analytics

  • State:closed
  • Created 9 years ago
  • Reactions:1634
  • Comments:151 (20 by maintainers)

github_iconTop GitHub Comments

3856reactions
jfmercercommented, Oct 28, 2017

This fixed it for me:

  1. Install Xcode
  2. Run sudo xcode-select -s /Applications/Xcode.app/Contents/Developer

See this explanation on SO.


EDIT(gibfahn): Command line tools is fine, you don’t need the full Xcode. Just ignore the warning. See here and here for more info.

375reactions
bergerjaccommented, Oct 28, 2017

EDIT(gibfahn): Command line tools is fine, you don’t need the full Xcode. Just ignore the warning. See here and here for more info.


Common Problems:

  • Error: xcode-select: error: tool ‘xcodebuild’ requires Xcode, but active developer directory is a command line tools instance
  • whether or not you installed XCode beta

Here’s all the answers from this thread and links compiled into one.

  1. Install Xcode or Xcode-beta
  2. Initiate Spotlight Search and type Xcode (Note whether you see Xcode, Xcode-beta, Xcode-87…)
  3. CMD+enter to open Xcode’s directory
  4. Open Xcode and Accept Terms and Conditions
  5. Move Xcode to /Applications directory ← NOT /Users/{user}/Applications
  6. Open Terminal
    • Xcode-beta: sudo xcode-select --switch /Applications/Xcode-beta.app/Contents/Developer
    • Xcode: sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer
    • Other: Get the proper path to your Xcode app. If yours is Xcode-87, then it would be: sudo xcode-select --switch /Applications/Xcode-87.app/Contents/Developer

Tested on

  • Macbook Pro, El Capitan OS X 10.11.6
Read more comments on GitHub >

github_iconTop Results From Across the Web

xcode-select active developer directory error - Stack Overflow
This problem happens when xcode-select developer directory was pointing to /Library/Developer/CommandLineTools when a full regular Xcode was required ...
Read more >
xcode-select: error: tool 'xcodebuild' requires Xcode, but active ...
xcode-select : error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance.
Read more >
ERROR: 'xcodebuild' requires Xcode - Apple Stack Exchange
Assuming your Xcode.app is installed in /Applications you can just run sudo xcode-select -s /Applications/Xcode.app/Contents/Developer/.
Read more >
Ionic Package: xcode-select: error: tool 'xcodebuild' requires ...
xcode-select : error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command ...
Read more >
CocoaPods Fails On Apple Silicon | Apple Developer Forums
Analyzing dependencies xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found