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.
nvm install 8.4.2 is installing a version of Node.js that is no longer supported
https://nodejs.org/en/about/releases
I know which version of Xcode is loa
Version 11.4 (11E146) Getting the same error
This stack overflow answer pointed me in the right direction. Hope it helps
https://stackoverflow.com/a/17980786
Uninstall the CLT:
sudo rm -rf /Library/Developer/CommandLineTools
xcode-select --install
This will reinstall:

Thanks for that! Finally compiling on my computer!
The issue was solved after updating npm:
npm install -g npm@latest
Biiiiiig thanks !!!
I have solved this problem by upgrading npm from 3.x to 6.x (before I grab all of my hair.)
But one thing weired, I have no Xcode.app directory under /Applications. (just command line tools installed. )
BTW, my system version is macOS Catalina 10.15.4.
Thanks agin.
@msjaber
It is not essential to have the XCode App as discussed in solutions 2. and 3.
I switched from nvm use 8 to nvm use 13. It fixed for me. No xcode related fix was required.
Uninstall the CLT:
sudo rm -rf /Library/Developer/CommandLineTools xcode-select --installThis will reinstall:
![]()
This one worked for me on a brand new install of Catalina
Tried to do what @robzor did, but I couldn't reinstall via xcode-select --install
Can't install the software because it is not currently available from the software update server
If you have issues with that, try downloading the installer for Command Line Tools for Xcode from: https://developer.apple.com/download/more/