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)
I had to re-install the xcode tools for some weird reason…
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
I had a similar issue with a different package:
Running on
macOS Catalina 10.15.2
, I tried:Fixed it by running the following:
I wouldn’t ever trust a
sudo rm -rf $(smth)
command. However, doing it it two steps solved the problem for me also:I do as this, too.
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, thensudo 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 tooI 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).
npm install -g node-gyp
node-gyp -v
which 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.
This helped me after updating from macOS 10.15.2 to 10.15.3
Reinstall works for me on mac OS Catalina
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:Good luck all!
Avoid using this command ever
sudo rm -rf ..
For mac you can use something liketrash
installed withbrew install trash
then use it for all your command line deletions! i.e.trash (xcode-select -print-path)
In Fish just drop the dollar!
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
.This solved my issue. Thanks
Had the same issue. Even after
I got the message
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
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 propernode-gyp
path (regularwhich
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!
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
Save my life, thank you!
not work
thank you. thats solv my problem.