Node.js installation encounters an error: 'gyp: No Xcode or CLT version detected!' during node-gyp build process

I receive an error whenever I try to install packages using npm. The problem occurs during the node-gyp build phase.

gyp: No Xcode or CLT version detected!

Details of my environment:

  • Node version: v8.8.0
  • NPM version: v6.11.3

I have tried running the command in various terminal applications, but the issue persists in all of them. This started happening after I updated my macOS to the latest Catalina version (10.15.3).

Here is the full error output I receive:

$ npm install

> [email protected] install /Users/dev/Projects/my-app/node_modules/chokidar/node_modules/fsevents
> 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 (/Users/dev/.nvm/versions/node/v8.8.0/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:344:16)
gyp ERR! System Darwin 19.3.0
gyp ERR! command "/Users/dev/.nvm/versions/node/v8.8.0/bin/node" "/Users/dev/.nvm/versions/node/v8.8.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/dev/Projects/my-app/node_modules/chokidar/node_modules/fsevents
gyp ERR! node -v v8.8.0
gyp ERR! node-gyp -v v5.0.3
gyp ERR! not ok

npm WARN [email protected] No repository field.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/chokidar/node_modules/fsevents):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] install: `node-gyp rebuild`
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1

What steps can I take to fix this issue with my installation?

Had the same issue after a macOS update wiped my command line tools. node-gyp couldn’t find the dev tools to compile native modules. To resolve this, run xcode-select --print-path to check your current path. If it exists, you can remove the old tools with sudo rm -rf $(xcode-select --print-path). Reinstall by running xcode-select --install and complete the GUI setup. After that, ensure xcode-select -p shows /Library/Developer/CommandLineTools. Finally, clear your npm cache with npm cache clean --force before attempting installation again. This approach resolved the gyp detection error for me on Catalina.

catalina messed up my setup too. first, try softwareupdate --all --install --force to get all your updates in place. then run xcode-select --install. updates can really screw things up, so make sure everything’s fresh before you try installing CLT.

Had this exact issue when I upgraded to Catalina last year. The macOS update kills your developer tools even if you had them installed before. Here’s what fixed it for me: First, I checked if anything was actually installed by running pkgutil --pkg-info=com.apple.pkg.CLTools_Executables - got nothing back. Instead of using xcode-select install, I grabbed the command line tools straight from Apple’s Developer portal. The automated installer often gets corrupted during macOS upgrades. After manually installing, I completely restarted my terminal and npm install worked fine. Just make sure the tools register properly with the system after you install them.

This build environment mess is exactly why I ditched local toolchain headaches completely. Every macOS update breaks something new and throws you into dependency hell.

I moved my entire Node.js workflow to automated cloud environments instead of wrestling with Xcode tools and command line installations. Need to install packages or run builds? I just trigger a workflow that handles everything in a clean environment every single time.

You’ll never worry about your local machine config again. No more “works on my machine” problems or wasting hours fixing broken toolchains after OS updates.

I set up workflows that auto-install dependencies, run builds, and deploy results. Takes 10 minutes to configure once, then you’re done with local installation issues forever.

You can build this automated setup with Latenode. It handles cloud execution and keeps development smooth no matter what your local OS does to your tools.

i had the same issue after upgrading to catalina. you’ll need the command line tools for node-gyp. just run sudo xcode-select --install and it should fix the prob. if that doesn’t do it, try sudo xcode-select --reset to reset the path.