1.问题描述
macOS版本macOS Catalina 10.15.2
,执行 npm install 时出现gyp报错:
No receipt for 'com.apple.pkg.CLTools_Executables' found at '/'.
No receipt for 'com.apple.pkg.DeveloperToolsCLILeo' found at '/'.
No receipt for 'com.apple.pkg.DeveloperToolsCLI' found at '/'.
gyp: No Xcode or CLT version detected!
2.解决方案
1.安装Xcode 命令行工具 Command Line Tools
xcode-select --install
2.同意服务条款
可能由于系统或xcode更新改变了相关文件。
打开Xcode,点击同意服务条款即可。
3.设置xcode路径
sudo xcode-select -s /Applications/Xcode.app/Contents/Developer
4.执行命令行工具初始化
sudo xcode-select --reset