`npm install` fails on node-gyp rebuild with `gyp: No Xcode or CLT version detected!`

前端 未结 13 1493
没有蜡笔的小新
没有蜡笔的小新 2020-12-07 12:56

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

相关标签:
13条回答
  • 2020-12-07 13:27

    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!

    0 讨论(0)
  • 2020-12-07 13:30

    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.

    1. uninstall xcode-select

    sudo rm -rf $(xcode-select -print-path)

    1. Go to the app store, and download XCode.

    2. Open XCode. On initial load, it will update/install stuff. let this happen.

    3. From Apple Developers, manually download Command Line Tools for Xcode 12

    4. Install the CLT for Xcode 12 package.

    You should now be good to go.

    0 讨论(0)
  • 2020-12-07 13:34

    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
    
    0 讨论(0)
  • 2020-12-07 13:34

    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.

    0 讨论(0)
  • 2020-12-07 13:35

    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.

    0 讨论(0)
  • 2020-12-07 13:37

    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.

    0 讨论(0)
提交回复
热议问题