question
Recently, when using npm to install modules in macOS Catalina, the following errors often occur:
> node-gyp rebuild
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 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:210:5)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:272:12)
gyp ERR! System Darwin 19.3.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/yangjian/Documents/temp/test001/node_modules/fsevents
gyp ERR! node -v v12.13.0
gyp ERR! node-gyp -v v5.0.5
gyp ERR! not ok
- Screenshot below
solution
1. Try to fix it with the following command
$ xcode-select --install
The system prompts the following information:
xcode-select: error: command line tools are already installed, use "Software Update" to install updates
In fact, there is no so-called “Software Update” to update
2. Correct posture
At a loss, I found the following solutions:
$ sudo rm -rf $(xcode-select -print-path)
$ xcode-select --install
Similar Posts:
- Gyp: no Xcode or CLT version detected!
- Mac download wepy error reporting solution
- [Solved] NPM downloads the dependency of the front-end Vue admin template master template Error
- Root permission NPM global installation (- G) will still have insufficient permissions. Please know the parameter unsafe perm
- [Solved] NPM run dev error [npm ERR! code ELIFECYCLE]
- [Solved] NPM installation error: error: eacces: permission denied
- Error: splash enomem problem [How to Solve]
- Node Sass could not find a binding for your current environment: Linux 64-bit with Node.js 7.x
- [xviz] ./scripts/run-kitti-example.sh Excute Error: gyp ERR! Node-gyp failed to build your package.
- [Solved] Error reporting of NPM packaged electron app