gyp: No Xcode or CLT version detected macOS Big Sur | Anansewaa.com

macOS Big Sur
It is that time of the year again for all apple enthusiast and the developers using MacBooks to make the jump to the latest operating system from Apple. macOS Big Sur (version 11) is the biggest design update to the desktop operating system since OS X debuted back in 2001 says Apple. Is the update worth it? most definitely but do not take my word for it, read more about the major changes from apple.com (Big Sur).
gyp: No Xcode or CLT version detected!
Noticed the consistent “gyp: No Xcode or CLT version detected!” in your terminal yet? After several updates and still having to fix these issues it somehow feels like brushing your teeth in the morning. Forgive my bad joke not the funniest guy out there.
Considering you made no changes to the previously install command line tools this error does not get any less annoying anytime it pops up. I detailed some steps to solve this in my previous article gyp: No Xcode or CLT version detected macOS Catalina | Anansewaa but Apple has made some changes since then hence those steps might not entirely solve the problem this time around.
Solution One
Run the following codes in your terminal as a Sudo user to correct the path to your installed command-line tools (CTL), enter your system password when prompted.
sudo xcode-select -r
Thanks to Sandro Würmli comment on my previous article on the same topic.
Solution Two
There are instances the proposed first solution might not work for you. If you find yourself in such a situation then follow the outlined steps to correct the “gyp: No Xcode or CLT version detected” error.
Step one
Remove the previously installed command-line tools. The command bellow should help remove the previously installed CTL (command-line tools). Enter your system password when prompted.
sudo rm -r -f /Library/Developer/CommandLineTools
Step two
Initiate the process of installing the command line tools by running the command below
xcode-select --install
Step three
Follow the prompt by clicking on the install button.

Step four
Agree to the command line tools license terms to continue the installations.

Patiently wait for the download to complete which is then succeeded by the installation of the command line tools. This process could take a while depending on your internet connection speed

Step five
You know the installation is completed when you see the installation completed screen as shown below.

Solution Three
If for any other reason proposed solutions one and two do not work for you there is the final proposal which should solve your problem.
You only try this solution if during the installation process you get the error “Can’t install the software because it is not currently available from the Software Update server.”
This solution was proposed by Timo Hausmann as a comment on my previous article.
Step one
Remove previously installed command-line tools with the following command.
sudo rm -r -f /Library/Developer/CommandLineTools
Step two
Visit the apple developer site to manually download the command-line tools.
Log in with your apple id when prompted to proceed to the download page.

Step three
Select the version of command-line tools to download, as of the time of writing this article the recommended version is 12.2

Click on the dmg link as shown in the image above to begin the download of the command-line tools.
Step four
Open or mount the downloaded dmg and double click the command-line-tools.pkg file in the mounted dmg file.

Follow the prompts to complete the installation of the command-line tools







Conclusion
One of the aforementioned steps should solve the “gyp: No Xcode or CLT version detected!” error. Until there is a long-lasting solution provided by apple, sadly we need to perform this quick fix anytime you upgrade or update your macOS Operating System. Until the next update or the upgrade, enjoy all the great feature of the latest and macOS.
Originally published at https://anansewaa.com on November 20, 2020.