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

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

提交回复
热议问题