日期:2021/06/22 天气:多云
项目背景
node项目,安装依赖包,出现以下问题
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!gyp ERR! configure errorgyp ERR! stack Error: `gyp` failed with exit code: 1gyp ERR! stack at ChildProcess.onCpExit (/Users/nianqing/.nvm/versions/node/v12.21.0/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:351:16)gyp ERR! stack at ChildProcess.emit (events.js:314:20)gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:276:12)gyp ERR! System Darwin 20.4.0gyp ERR! command "/Users/nianqing/.nvm/versions/node/v12.21.0/bin/node" "/Users/nianqing/.nvm/versions/node/v12.21.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"gyp ERR! cwd /Users/nianqing/Documents/BANU_Project/BANU_DataExchangeService/node_modules/watchpack/node_modules/fseventsgyp ERR! node -v v12.21.0gyp ERR! node-gyp -v v5.1.0gyp ERR! not ok> fsevents@1.2.13 install /Users/nianqing/Documents/BANU_Project/BANU_DataExchangeService/node_modules/webpack-dev-server/node_modules/fsevents> node install.jsNo 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!gyp ERR! configure errorgyp ERR! stack Error: `gyp` failed with exit code: 1gyp ERR! stack at ChildProcess.onCpExit (/Users/nianqing/.nvm/versions/node/v12.21.0/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:351:16)gyp ERR! stack at ChildProcess.emit (events.js:314:20)gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:276:12)gyp ERR! System Darwin 20.4.0gyp ERR! command "/Users/nianqing/.nvm/versions/node/v12.21.0/bin/node" "/Users/nianqing/.nvm/versions/node/v12.21.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"gyp ERR! cwd /Users/nianqing/Documents/BANU_Project/BANU_DataExchangeService/node_modules/webpack-dev-server/node_modules/fseventsgyp ERR! node -v v12.21.0gyp ERR! node-gyp -v v5.1.0gyp ERR! not ok
解决方案
即使你已经安装了它们(我的情况),但是通过升级到 Catalina(10.15.),依然会出现这个问题
因此,简单地安装无济于事,您需要再次卸载并安装(需要大量重新_*下载_)它们:
你不需要为每个项目做一次,只需一次
xcode-select --print-path# in my case /Library/Developer/CommandLineTools# the next line deletes the path returned by the command abovesudo rm -rf $(xcode-select --print-path)# install them (again) if you don't get a default installation promptxcode-select --install
