Mac OS Node.js gpy 报错:No receipt for 'com.apple.pkg.CLTools_Executables' found at '/'
Timeliness Warning · Last updated
4 years 1 month ago
The information in this article may be outdated. Please verify carefully.
在 Mac 上使用 yarn 安装依赖包时,gpy 遇到以下问题出错:
plaintext
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 '/'.
之后搜索找到 Is this an Issue with MACOS catalina? · Issue #1927 · nodejs/node-gyp
在终端运行 xcodebuild
命令得到同样报错:
plaintext
xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance
之后根据 此回复 找到 xcode-select: error: tool ‘xcodebuild’ requires Xcode, but active developer directory ‘/Library/Developer/CommandLineTools’ is a command line tools instance · Issue #569 · nodejs/node-gyp
解决方法是执行命令:
plaintext
sudo xcode-select -s /Applications/Xcode.app/Contents/Developer