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

前端 未结 13 1491
没有蜡笔的小新
没有蜡笔的小新 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: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.

提交回复
热议问题