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
I did exactly this, my issue is gone now.
First:
xcode-select --print-path
it gave path /Library/Developer/CommandLineTools
so:
sudo rm -rf /Library/Developer/CommandLineTools
xcode-select --install
it pops up the install window, just install and you are on your way.
Thanks Stackoverflow!
Running xcode-select --install
attempts an install, but fails with the following error: Can't install the software because it is not currently available from the Software Update server.
Here's what worked for me.
OS: Catalina 10.15.6
Xcode-select version: 2373
NOTE: Before running all this, I already had xcode-select version 2373 installed. But removing and reinstalling fixed the issue.
sudo rm -rf $(xcode-select -print-path)
Go to the app store, and download XCode.
Open XCode. On initial load, it will update/install stuff. let this happen.
From Apple Developers, manually download Command Line Tools for Xcode 12
Install the CLT for Xcode 12 package.
You should now be good to go.
I was facing the same issue
I reinstalled the command line tools.
You need to find the installation directory.
xcode-select --print-path
Delete the existing installation:
sudo rm -r -f /Library/Developer/CommandLineTools
Install by running:
xcode-select --install
This happens most of the time when there is new OS updates happens. But I found a solutions to tackle this problem. You need to follow the below steps to solve.
Reinstall command-line tools by removing the previously installed version.
step1: First, get the location of the installed command-line tools
xcode-select --print-path
the result of the above command /Library/Developer/CommandLineTools
step2: removed the folder
sudo rm -rf /Library/Developer/CommandLineTools
step3 - install again
xcode-select --install
With the reinstallation of the command line developer tools the gyp: No Xcode or CLT version detected error message should disappear when you run any yarn or npm commands from the command line.
This worked for me with macOS Catalina Version 10.15.5:
$ xcode-select --print-path
/Applications/Xcode.app/Contents/Developer
$ sudo xcode-select --switch /Library/Developer/CommandLineTools
...
$ sudo xcode-select --reset
...
The xcode cli tools should now be accessible. No need to re-install anything.
If your Mac has been upgraded to macOS Catalina (10.15)
, you need to install the XCode Command Line Tools by running xcode-select --install
. Alternatively, if you already have the full Xcode installed, you can find them under the menuXcode → Open Developer Tool → More Developer Tools
.