Xcode 报错处理

安装依赖时出现报错消息

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! I'M RUNNING XCODE 11.2beta
gyp ERR! configure error
gyp ERR! stack Error: gyp failed with exit code: 1
gyp ERR! stack at ChildProcess.onCpExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:351:16)
gyp ERR! stack at ChildProcess.emit (events.js:198:13)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:248:12)
gyp ERR! System Darwin 19.0.0
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/drjosephdavids/node_modules/keccakjs/node_modules/sha3
gyp ERR! node -v v10.16.3
gyp ERR! node-gyp -v v5.0.5
gyp ERR! not ok
npm WARN enoent ENOENT: no such file or directory, open '/Users/drjosephdavids/package.json'
npm WARN drjosephdavids No description
npm WARN drjosephdavids No repository field.
npm WARN drjosephdavids No README data
npm WARN drjosephdavids No license field.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! sha3@1.2.3 install: node-gyp rebuild
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the sha3@1.2.3 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! /Users/drjosephdavids/.npm/_logs/2019-10-16T17_41_20_021Z-debug.log

根据https://stackoverflow.com/questions/34617452/how-to-update-xcode-from-command-line
执行命令

 xcode-select --install

报错

xcode-select: error: command line tools are already installed, use "Software Update" to install updates

根据https://stackoverflow.com/a/34617930
卸载后重装,解决问题