0

On macOS Big Sur, with node v14.17.1, when I run npm install (for the package jq)
then I get the error (during the installation of the dependent node_module contextify):

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!

Note that I already installed the Xcode command-line tools. xcode-select --install displays:

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

and no possible update appears in "Software Update".

Note: Unsure if that's related, but my Mac had an OS update earlier today...

Pierre F
  • 1,332
  • 15
  • 33
  • Similar question for macOS Catalina: https://stackoverflow.com/questions/64615425/npm-install-and-fails-on-node-gyp-rebuild-with-gyp-no-xcode-or-clt-version-d – Pierre F Jul 27 '21 at 12:46

1 Answers1

0

The repository node-gyp contains a dedicated troubleshooting guide for macOS Catalina:

https://github.com/nodejs/node-gyp/blob/master/macOS_Catalina.md

Apparently, it still applies also for macOS Big Sur

TLDR:

Installation notes for macOS Catalina (v10.15)

Both upgrading to macOS Catalina and running a Software Update in Catalina may cause normal node-gyp installations to fail. This might manifest as the following error during npm install:

gyp: No Xcode or CLT version detected!

Solutions

There are three ways to install the Xcode libraries node-gyp needs on macOS. People running Catalina have had success with some but not others in a way that has been unpredictable.

  • With the full Xcode (~7.6 GB download) from the App Store app.
  • With the much smaller Xcode Command Line Tools via xcode-select --install
  • With the much smaller Xcode Command Line Tools via manual download.

This "solved" it for me:

Download the current Command Line Tools for Xcode from the Apple Developer webpage: https://developer.apple.com/download/all/?q=command

(Currently: Command Line Tools for Xcode 12.5.1, installer size 483 MB, requires 2.7 GB disk space)

Though I get further build errors during node-gyp rebuild now... (for the package contextify) - but that's something that probably should be addressed separately.

Pierre F
  • 1,332
  • 15
  • 33