xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance
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.
I do not want install xcode, it's stupid. How can i do
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.
Why should this force an installation of the overbloated xcode instead of xcode command line tools?
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.
I don't think we have any control over the message this prints, it comes out of OSX.
The best resource I've seen on this whole mess is actually from a rails documentation project: http://railsapps.github.io/xcode-command-line-tools.html, it's pretty complete and we'd do well to either link to it or borrow large chunks of it for our own documentation.
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.
So, I just want to confirm this.
node-gyp has a hard dependency on XCode (the entire IDE) that cannot be fulfilled by CommandLineTools?
EDIT(gibfahn): No, Command line tools is fine, you don't need the full Xcode. Just ignore the warning. See here and here for more info.
Yeah, that's whats really strange
no, this is not correct, the commandline tools should be just fine, it's just a matter of wiring up xcode-select to use them by default I think, some kind of OSX magic I don't know off the top of my head
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.
It Worked! You guys rock. Thanks!
sudo xcode-select -s /Applications/Xcode-Beta.app/Contents/Developer
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.
The first time it failed for me was because I've attempted to install an older version of sqlite:
npm install [email protected] --save
I then installed the latest version and it went through just fine, no xcode required:
npm install [email protected] --save
I write to confirm @davis ' suggestion, followed by running sudo xcode-select -s /Applications/Xcode.app/Contents/Developer solved it for me.
FYI anyone using a new MacBook or doing a first install of xCode needs to accept the terms/conditions ;)
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.
@rvagg nice find! I've updated my original post with that link so people who run into this in the future hopefully see that link.
So there is no way to get around this other than installing a 6GB XCode application? Are you kidding me? I don't see the point here.
EDIT(gibfahn): No, Command line tools is fine, you don't need the full Xcode. Just ignore the warning. See here and here for more info.
You can try downloading clang from http://llvm.org/releases/download.html but you'll be on your own, it's not a supported configuration.
Got it, I've solved this problem
Nice!
sudo xcode-select -s /Applications/Xcode.app/Contents/Developer
It works good for me on Mac OS X El Capitan...
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.
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.
- Install Xcode or Xcode-beta
- Initiate Spotlight Search and type
Xcode(Note whether you seeXcode,Xcode-beta,Xcode-87...) - CMD+enter to open Xcode's directory
- Open Xcode and Accept Terms and Conditions
- Move Xcode to
/Applicationsdirectory ← NOT/Users/{user}/Applications - 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
- Xcode-beta:
Tested on
- Macbook Pro, El Capitan OS X 10.11.6
I have a simple fix that may be of help when installing Xcode beta for some reason in stays in your downloads folder if you just move it to your application folder that may solve the problem worked for me
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.
This is the error when I ran 'ionic build ios' in the terminal. "Error: xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance"
I just updated the Xcode a few days ago. My OS is macOS Sierra 10.12.1
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.
So there is no way without full XCode installation? I don't want to waste disk space on something I will never use.
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.
@vedmant unfortunately no
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.
@vedmant I just tried, and I am able to build with node-gyp using the Command Line tools instance. I still see these warning messages, but the node-gyp build did work.
xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance
xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance
Commands I used were:
- Install command line tools:
xcode-select --install - Switch to using (already installed) command line tools:
sudo xcode-select --switch /Library/Developer/CommandLineTools - Show which version you're currently using:
xcode-select -p- Mine was
/Library/Developer/CommandLineTools
- Mine was
Could you give an example of something that didn't work for you?