问题
最近在macOS Catalina中使用npm安装模块,经常会出现如下错误:
gyp: No Xcode or CLT version detected!
截图如下
解决方案:
1. 命令进行修复
$ xcode-select --install
提示如下信息:
xcode-select: error:commandline tools are already installed, use"Software Update"to install updates
而事实上并没有所谓的"Software Update"可以更新
可使用如下解决方案:
$ sudo rm -rf $(xcode-select -print-path)
$ xcode-select --install