Every time I try npm install
. I get the following error. How do I fix it?
gyp: No Xcode or CLT version detected!
I am on n
Try these commands:
sudo rm -rf $(xcode-select -print-path)
xcode-select --install
I guess, you may have tried multiple solutions so far but if none of those solutions have worked for you yet, don't worry - I got you. :)
Non-working Solutions:
xcode-select --install
didn't work for me (macOS Catalina 10.15.7) as it shows up a Software Update dialog box which says Can't install the software because it is currently not available from the Software Update Server
.sudo xcode-select --reset
also didn't do the trick for me.Working Solution:
Here is what worked for me i.e. reinstall Xcode Command Line Tools using Software Update manually.
softwareupdate -l
sudo touch /tmp/.com.apple.dt.CommandLineTools.installondemand.in-progress
softwareupdate -l
again.Software Update
. Start the Software Update
.sudo rm /tmp/.com.apple.dt.CommandLineTools.installondemand.in-progress
.on catalina had to manually install command line tools for xcode from https://developer.apple.com/download/more/
Even though you have them installed (my case), but by upgrading to Catalina (10.15.*) you can get this error (my case :) ).
Therefore, simply installing wouldn't help as you will get an error that they are already installed.
Therefore you need to uninstall and install them again:
xcode-select --print-path
# in my case /Library/Developer/CommandLineTools
# the next line deletes the path returned by the command above
sudo rm -rf $(xcode-select --print-path)
# install them (again) if you don't get a default installation prompt
xcode-select --install
NOTE:
Credits to: gyp: No Xcode or CLT version detected macOS Catalina
you will need to install xcode or command line tools
On macOS Catalina:
sudo rm -rf $(xcode-select --print-path)
;