Mac系统,在用npm安装依赖包的时候总会报这个错误:gyp: No Xcode or CLT version detected!
原因是Xcode命令行工具有问题,需要删掉重装。
1 查看安装路径
xcode-select --print-path
默认的路径应该是/Library/Developer/CommandLineTools
2 删除
sudo rm -r -f /Library/Developer/CommandLineTools
3 重新安装
xcode-select --install
这个工具包大小400多m很快就能装完