Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save berkedel/d5494edbf3c92e627fbda5027e04fe40 to your computer and use it in GitHub Desktop.
Save berkedel/d5494edbf3c92e627fbda5027e04fe40 to your computer and use it in GitHub Desktop.
Fix `xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance`

Tried to create react app

npx create-react-app app

Unfortunately, got an xcodebuild error

node-pre-gyp ERR! Tried to download(404): https://fsevents-binaries.s3-us-west-2.amazonaws.com/v1.0.17/fse-v1.0.17-node-v57-darwin-x64.tar.gz
node-pre-gyp ERR! Pre-built binaries not found for [email protected] and [email protected] (node-v57 ABI) (falling back to source compile with node-gyp)
xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance

To fix this, make sure already install xcode command tools

xcode-select --install

And run this

sudo xcode-select --switch /Library/Developer/CommandLineTools

Open your Xcode, then go to Xcode > Preferences > Locations. Then, make Command Line Tools to installed one, for me it was Xcode 11.3 (11C29).

Check if it is still error or not by typing

xcodebuild -version
@ProgrammerNephi
Copy link

I have the same problem.

@ghana7989
Copy link

worked like charm thanks

@subhash639
Copy link

I had the same issue and it's resolved now. Thanks!

@nghuuquyen
Copy link

nghuuquyen commented Apr 13, 2024

It's worked for me. Thanks

@hyezb
Copy link

hyezb commented Jun 10, 2024

didn't work for me, had to do sudo xcode-select -s /Applications/Xcode.app/Contents/Developer

@dwivedi-vikas
Copy link

didn't work for me, had to do sudo xcode-select -s /Applications/Xcode.app/Contents/Developer

It worked for 15.4

@j03ll0b0
Copy link

j03ll0b0 commented Jul 5, 2024

worked very well, thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment