在运行npm install的时候遇到下面的报错:
报错:gyp: No Xcode or CLT version detected!
原因:
node-gyp
需要Xcode Command Line Tools。
解决办法:可以通过运行此命令 x
code-select --install安装Xcode来解决。
如果上述命令运行报错,可以先运行
sudo rm -rf $(xcode-select -print-path) 再运行x
code-select --install
背景:macos BigSur 11.1版本