These are notes for myself on an issue I had recently and the resolution that worked for me ...
I recently updated my Mac OS. What I immediately noticed any time I ran either
yarn install or
npm install, I got this new error:
gyp: No Xcode or CLT version detected! gyp ERR! configure error
Keep in mind that this wasn't event close to the complete list of errors. The messages ran on and on. The funny thing is I do have these command line tools installed.
The result of
xcode-select --install starts the re-installation process, but if you get the message below then you (as I did) already have the command line tools installed.
Xcode-select: error: command line tools are already installed, use "Software Update" to install updates
Reinstall the command-line tools by removing the previously installed version, then reinstall them.
Get the location of the installed command-line tools by running the command below:
Which gives the results from the command above (here's what I got) ...
Knowing the path to the currently installed command-line tools from the previous step, go ahead and remove them from the system. For the next set of commands, you will need sudo privileges to run successfully.
sudo rm -r -f /Library/Developer/CommandLineTools
Provide the root password to remove the command line tools, when prompted.
Click on install and follow the rest of the instructions to reinstall command line developer tools.
If for some reasons, you do not get the prompt right after uninstalling your previous command line developer tools, no need to panic. Run the following command to get the prompt.
Click on install and then agree to the license to proceed with the installation. Depending on your internet speed it will take some time for the system to complete the download of the command line developer tools. The installation process should proceed immediately after a successful download.
With the reinstallation of the command line developer tools the
gyp: No Xcode or CLT version detected! error message should disappear when any yarn or npm command is run from the command line.