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'm looking for the same answer.
@alejandroiglesias, try this: download Xcode from the app store, open it and accept the license/terms agreement, and try whatever you were doing again.
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 fixed it for me:
- Install Xcode
- 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.
Same answer as @jfmercer . But if you installed XCode beta, use this command instead:
sudo xcode-select -s /Applications/Xcode-Beta.app/Contents/Developer
@nitinnain if i use your command i get xcode-select: error: invalid developer directory '/Applications/Xcode-Beta.app/Contents/Developer' i have Xcode7 beta 6 :S
@Tibicenas @nitinnain - same here: xcode-select: error: invalid developer directory '/Applications/Xcode-Beta.app/Contents/Developer'
@Tibicenas @dbranchini did either of you try my suggestion?
@davis finally i uninstalled Xcode and re-install and then doing the xcode-select -switch works.. anyway its a weird issue that should be fixed in the next patch
@davis I tried your suggestion, it worked. thanks!
Is there no way to not use xcodebuild? I don't want to waste 6GB of disk on pointless crap
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.
Agreed with @wmertens
You can maybe circumvent the xcode-specific logic by passing -DOS=mac -f make-linux to node-gyp (check the source) but it's not supported. I'll close the issue.
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.
But if you installed XCode beta, use this command instead: sudo xcode-select -s /Applications/Xcode-Beta.app/Contents/Developer hah, it's worked!
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.
XCode2: sudo xcode-select -s /Applications/Xcode\ 2.app/Contents/Developer
Pay attention to the "" to escape the space
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.
im having this problem what is the password when you do sudo xcode-select -s /Applications/Xcode.app/Contents/Developer
@jesstomo12 your sudo password
I have the same error: "xcode-select: error: invalid developer directory '/Applications/Xcode.app/Contents/Developer'" I also tried: 1. Install Xcode 2. Run sudo xcode-select -s /Applications/Xcode.app/Contents/Developer or Run sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer Nothing works. How I know which version of Xcode is loaded?
@dharmanibc xcode-select -print-path
Thanks! The problem is solved now. Actually, this was an map-error on OS X 10.10, as somehow it checks for some module to be available for 10.11 and which is not available for 10.10. So, simply, I ignored the error msg. The fink seems properly installed. Thanks again!
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 problem happens when xcode-select developer directory was pointing to /Library/Developer/CommandLineTools, when a full regular XCode was required (happens when CLT are installed after XCode)
Solution:
Install Xcode (get it from https://developer.apple.com/xcode/) if you don't have it yet,
Point xcode-select to the Xcode Developer directory using the following command:
sudo xcode-select -s /Applications/Xcode.app/Contents/Developer
Note: Make sure your Xcode app directory is the same as in the address above; most notably, it'll be probably /Applications/Xcode-Beta.app/Contents/Developeror /Applications/Xcode-beta.app/Contents/Developer if you installed beta XCode release instead.
The Source: http://stackoverflow.com/questions/17980759/xcode-select-active-developer-directory-error/17980786#17980786