gyp: No Xcode or CLT version detected on macOS – Fix

Erik Larsson – August 6, 2020

ERR! gyp: No Xcode or CLT version detected!

If you recently updated your macOS and started to get this error when running yarn or npm, this is the guid to help you solve this problem.

The solution is simple but not easy to execute, we need to reinstall the command line tools, Xcode.

Step 1 – Check your installation

First off, check that you have Xcode installed on your computer. In your terminal run

xcode-select --install

If you dont have Xcode installed this will start the process and once installed, your problem is solved.

Step 2 – Reinstall

If you have Xcode installed and need to fix the problem with No Xcode or CLT version Detected! We need to reinstall it.

Get the path of your current version of Xcode

xcode-select --print-path

The output should be something like this /Library/Developer/CommandLineTools

Step 3 – Remove the old version

When you have the path for your current version of Xcode you need to delete that folder in order to start a fresh installation.

sudo rm -r -f /Library/Developer/CommandLineTools

Step 4 – Install a fresh version of Xcode

Now that you succeed with removing the CommandLineTools folder, you need to start install Xcode.

xcode-select --install

Click the install button on the dialog that appears, wait a few minites and then you are all done!


Similar articles