Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save radekg/aaef238d10c236bfd0c8e009e0385d52 to your computer and use it in GitHub Desktop.
Save radekg/aaef238d10c236bfd0c8e009e0385d52 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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment