Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • 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 fsevents@1.0.17 and node@8.6.0 (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

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