d3-scale-cluster: npm install fails on node-gyp rebuild with "gyp: No Xcode or CLT version detected!"

error code

> ckmeans@1.0.1 install /Users/project/node_modules/ckmeans
> node-gyp rebuild

xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance

xcode-select: error: tool 'xcodebuild' requires Xcode, but active developer directory '/Library/Developer/CommandLineTools' is a command line tools instance

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:305:16)
gyp ERR! stack     at emitTwo (events.js:106:13)
gyp ERR! stack     at ChildProcess.emit (events.js:191:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:215:12)
gyp ERR! System Darwin 16.0.0
gyp ERR! command "/usr/local/Cellar/node/8.1.3/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/project/node_modules/ckmeans
gyp ERR! node -v v7.0.0
gyp ERR! node-gyp -v v3.4.0
gyp ERR! not ok 
npm WARN facilio@0.0.1 No repository field.
npm WARN facilio@0.0.1 No license field.
npm ERR! Darwin 16.0.0
npm ERR! argv "/usr/local/Cellar/node/8.1.3/bin/node" "/usr/local/bin/npm" "install" "--save" "d3-scale-cluster"
npm ERR! node v7.0.0
npm ERR! npm  v3.10.8
npm ERR! code ELIFECYCLE

npm ERR! ckmeans@1.0.1 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the ckmeans@1.0.1 install script 'node-gyp rebuild'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the ckmeans package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-gyp rebuild
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs ckmeans
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls ckmeans
npm ERR! There is likely additional logging output above.

npm ERR! Please include the following file with any support request:
npm ERR!     /Users/project/npm-debug.log

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 82
  • Comments: 56 (1 by maintainers)

Most upvoted comments

I had to re-install the xcode tools for some weird reason…

sudo rm -rf $(xcode-select -print-path)
xcode-select --install

That is listed in the bottom of the guide (https://github.com/nodejs/node-gyp/blob/master/macOS_Catalina.md). So thank you!

@prasanthmaran1 this library contains a native addon for extra performance in node environments, what this means is that you should have a c compiler installed on your system. This is fairly common in the node ecosystem.

See instructions here: https://github.com/nodejs/node-gyp#on-macos

In most cases this is as easy as running xcode-select --install on your mac.

Let me know if that works.

following step help me to resolve this issue on Mac Catalina OS

sudo rm -rf $(xcode-select -print-path)
xcode-select --install
/usr/sbin/pkgutil --packages | grep CL
sudo npm install -g node-gyp

I had a similar issue with a different package:

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

Running on macOS Catalina 10.15.2, I tried:

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

Fixed it by running the following:

$ [sudo] xcode-select --reset

I wouldn’t ever trust a sudo rm -rf $(smth) command. However, doing it it two steps solved the problem for me also:

> xcode-select -print-path
/Library/Developer/CommandLineTools
> sudo rm -rf /Library/Developer/CommandLineTools

I had to re-install the xcode tools for some weird reason…

sudo rm -rf $(xcode-select -print-path)
xcode-select --install

That is listed in the bottom of the guide (https://github.com/nodejs/node-gyp/blob/master/macOS_Catalina.md). So thank you!

I do as this, too.

I had to re-install the xcode tools for some weird reason…

sudo rm -rf $(xcode-select -print-path)
xcode-select --install

That is listed in the bottom of the guide (https://github.com/nodejs/node-gyp/blob/master/macOS_Catalina.md). So thank you!

This worked for me in MacOs catalina.

Please don’t run rm -rf $(any command at all), ever!

Just run xcode-select -print-path, confirm the path, then sudo rm -rf that_path. What if the command errored and output a single / or the path to your home directory. Destruction would ensue! Fundamentally, the advice to reinstall xcode is good. Having to do it at all is not so good 😕

If you don’t want to re-install xcode, you can also point xcode-select to the existing installation:

sudo xcode-select -s /Applications/Xcode.app/Contents/Developer

Make sure to open xcode at least once after installation to accept the terms.

Looks like sudo xcode-select --reset fixed my issue without needing to reinstall Xcode entirely.

sudo xcode-select --reset did the trick too

I hate that reinstalling the Xcode tools worked, but it did.

I bought a brand new MBP today and installed Xcode on it for the first time a few hours ago (and xcode-select reported the tools were already installed). Really have no idea why this is necessary. Thanks, internet friends 🙏

perfect work for me. using xcode-select --install on mac. Thank you.

I’ve fixed this by forcing npm to use a later version of node-gyp (at least version 7).

  1. Install node-gyp globally npm install -g node-gyp
  2. Confirm you’re on a version 7 or higher node-gyp -v
  3. Get the path to the script which node-gyp
  4. Update npm config to use this version of node-gyp npm config set node_gyp /path/from/previous/step

This is hopefully a more permanent solution than always needing to re-install xcode-select tools. Unfortunately that is something I’ve found myself having to do time and time again.

The only gotcha is that, in my case (using nvm to manage my node version), when I update node, I’ll have to update this config again. Still, I’d rather that than reinstall xcode-select every time.

Working good for me so far; YMMV.

I had to re-install the xcode tools for some weird reason…

sudo rm -rf $(xcode-select -print-path)
xcode-select --install

That is listed in the bottom of the guide (https://github.com/nodejs/node-gyp/blob/master/macOS_Catalina.md). So thank you!

This helped me after updating from macOS 10.15.2 to 10.15.3

I had to re-install the xcode tools for some weird reason…

sudo rm -rf $(xcode-select -print-path)
xcode-select --install

That is listed in the bottom of the guide (https://github.com/nodejs/node-gyp/blob/master/macOS_Catalina.md). So thank you!

Reinstall works for me on mac OS Catalina

I had a similar issue with a different package:

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

Running on macOS Catalina 10.15.2, I tried:

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

Fixed it by running the following:

$ [sudo] xcode-select --reset

This worked for me by only having to run xcode-select --reset. I would try this first before removing anything!

Second time a row Catalina updates (10.15, 10.15.1) break CLT. Removing existing dir and re-installing CLT works, but it’s pretty annoying.

This fixed it for me: First reset: sudo xcode-select -r Then accept license: sudo xcodebuild -license

It’s time for them to rename their X-code to XXX-code… Thank you very much, SK-CSE ! /usr/sbin/pkgutil --packages | grep CL resolves the issue on Catalina.

This issue keeps coming up for me every so often; likely tied to minor upgrades to OS X. xcode-select --reset does not seem to ever work for me. I end up resorting to a fresh install of the command line tools:

trash $(xcode-select -print-path)
xcode-select --install
# wait ten minutes... (◔_◔)

Good luck all!

Avoid using this command ever sudo rm -rf .. For mac you can use something like trash installed with brew install trash then use it for all your command line deletions! i.e. trash (xcode-select -print-path)

I’m currently on Catalina, following the reinstall commands:

sudo rm -rf $(xcode-select -print-path)
xcode-select --install

I use fish as a shell and it didn’t like the $( …) command. Just wanted to mention that to work around it quickly, I just went into the Vscode terminal window and in the shell dropdown choose ‘select default shell’, choose a new shell from the top list (I used bash), then hit the ‘+’ to open a new bash console. Then I could follow the commands directly without wrecking my fish shell setup.

In Fish just drop the dollar!

sudo rm -rf (xcode-select -print-path)
xcode-select --install

I previously went through the steps to fix the issue via command line, but the exact same issue popped up again later. This time I installed via the Xcode interface, which takes you to https://developer.apple.com/download/more/?=for Xcode where you can download the latest tools under Command Line Tools for Xcode x.x. Fixed it for now, hopefully for good.

EDIT: It’s happened again after updating Xcode. Looks like you just need to open Xcode, get prompted with “Install additional required components?”, and click Install.

I had a similar issue with a different package:

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

Running on macOS Catalina 10.15.2, I tried:

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

Fixed it by running the following:

$ [sudo] xcode-select --reset

This solved my issue. Thanks

I am having this error and nothing here has worked.

Had the same issue. Even after

sudo rm -rf (xcode-select -print-path)
xcode-select --install

I got the message

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

Even sudo xcode-select --reset did not fix anything and basically I ended up with a partly uninstalled xcode so I couldn’t reinstall xcode from the app store too.

I used https://nektony.com/mac-app-cleaner to fully uninstall xcode and reinstalled xcode again from the app store. That worked out great.

Hope it helps to solve your problem too

following step help me to resolve this issue on Mac Catalina OS

sudo rm -rf $(xcode-select -print-path)
xcode-select --install
/usr/sbin/pkgutil --packages | grep CL
sudo npm install -g node-gyp

This worked perfectly!

Time and again, I have to install x-code what is the main issue??

Getting same,

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 ‘/’.

The only thing which helps me is to install CLI Tools manually from the Apple developers website. But I have to do this every time I update my macOS. It’s horrible! 😦

Thanks @kaiwoods. I use asdf and bump into this as I dance around projects with different versions of node. For my asdf world I needed to asdf which node-gyp to fetch the proper node-gyp path (regular which will give you the asdf shim). Hope that helps asdf users. And seriously, thanks @kaiwoods!!!

If you have a server response problem after xcode-select --install command.

Download the Command Line Tools for Xcode directly from https://developer.apple.com/download/more/

My xcode recently updated and I ran into this problem for the second time. Instead of re-installing which I did the first time, I ran sudo xcode-select -s /Applications/Xcode.app/Contents/Developer to point to the existing install location like @nwittstruck mentioned.

Worked perfect, thanks!

following step help me to resolve this issue on Mac Catalina OS

sudo rm -rf $(xcode-select -print-path)
xcode-select --install
/usr/sbin/pkgutil --packages | grep CL
sudo npm install -g node-gyp

I tried uninstalling and reinstalling, that didn’t work. The global node-gyp install made it work.

Only thing that worked for me was a comment by inglkruiz on here: https://github.com/nodejs/node-gyp/issues/1927

I had to re-install the xcode tools for some weird reason…

sudo rm -rf $(xcode-select -print-path)
xcode-select --install

That is listed in the bottom of the guide (https://github.com/nodejs/node-gyp/blob/master/macOS_Catalina.md). So thank you!

Save my life, thank you!

perfect work for me. using xcode-select --install on mac. Thank you.

not work

I’m currently on Catalina, following the reinstall commands:

sudo rm -rf $(xcode-select -print-path)
xcode-select --install

I use fish as a shell and it didn’t like the $( …) command. Just wanted to mention that to work around it quickly, I just went into the Vscode terminal window and in the shell dropdown choose ‘select default shell’, choose a new shell from the top list (I used bash), then hit the ‘+’ to open a new bash console. Then I could follow the commands directly without wrecking my fish shell setup.

In Fish just drop the dollar!

sudo rm -rf (xcode-select -print-path)
xcode-select --install

thank you. thats solv my problem.