Skip to content

npm install fails on node-gyp rebuild with "gyp: No Xcode or CLT version detected!" #7

Closed
@prasanthmaran1

Description

@prasanthmaran1

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

Activity

schnerd

schnerd commented on Jul 4, 2018

@schnerd
Owner

@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.

changed the title [-]Cannot able to install npm d3-scale-cluster package [/-] [+]Install fails on node-gyp rebuild with "gyp: No Xcode or CLT version detected!"[/+] on Jul 4, 2018
changed the title [-]Install fails on node-gyp rebuild with "gyp: No Xcode or CLT version detected!"[/-] [+]npm install fails on node-gyp rebuild with "gyp: No Xcode or CLT version detected!"[/+] on Jul 4, 2018
prasanthmaran1

prasanthmaran1 commented on Jul 8, 2018

@prasanthmaran1
Author

Thanks @schnerd package installed successfully...

gilbertomangones

gilbertomangones commented on Aug 20, 2019

@gilbertomangones

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

paul4156

paul4156 commented on Nov 7, 2019

@paul4156

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!

tinker-li

tinker-li commented on Nov 7, 2019

@tinker-li

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.

Fil

Fil commented on Nov 7, 2019

@Fil

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
SK-CSE

SK-CSE commented on Nov 9, 2019

@SK-CSE

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
wangxiaocuo

wangxiaocuo commented on Nov 25, 2019

@wangxiaocuo

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!

Thank you !!! very much

44 remaining items

wangxiaocuo

wangxiaocuo commented on May 13, 2020

@wangxiaocuo

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

Sometimes it works, sometimes it doesn't.
So I suggest you use yarn to avoid the pain.
Or you can choose to use less instead of SCSS.

gschema

gschema commented on May 18, 2020

@gschema

@prasanthmaran1 hey mate, can you add this link:

The solution for the node-gyp problem/error on macOS Catalina "No receipt for 'com.apple.pkg.CLTools_Executables' found at '/'."

In similar fashion like @joe-nano did at the top of his initial post here:

nodejs/node-gyp#1927

My issue background:

On my machine node-gyp got broken totally randomly and have no idea what to connect that break/corruption to. The system works perfectly fine and has 0 issues. After a restart it got reported as broken after running yarn. It was installed and present in the system but installation was corrupted for some reason. Interesting.

atipugin

atipugin commented on Jun 3, 2020

@atipugin

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.

bohehe

bohehe commented on Jun 19, 2020

@bohehe

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!

omjha1505

omjha1505 commented on Oct 3, 2020

@omjha1505
m-a-r-c-e-l-i-n-o

m-a-r-c-e-l-i-n-o commented on Oct 14, 2020

@m-a-r-c-e-l-i-n-o

Only thing that worked for me was a comment by inglkruiz on here: nodejs/node-gyp#1927

halkemist

halkemist commented on Oct 28, 2020

@halkemist

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/

kaiwoods

kaiwoods commented on Nov 12, 2020

@kaiwoods

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.

nadnoslen

nadnoslen commented on Dec 4, 2020

@nadnoslen

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!!!

AlexeySmolyaninov

AlexeySmolyaninov commented on Dec 8, 2020

@AlexeySmolyaninov

I have had an old node version after I have updated it to a new stable one it fixed my problem.

Pearel-Skillate

Pearel-Skillate commented on Feb 18, 2021

@Pearel-Skillate

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @Fil@davidcalhoun@sgentile@atipugin@gschema

        Issue actions

          npm install fails on node-gyp rebuild with "gyp: No Xcode or CLT version detected!" · Issue #7 · schnerd/d3-scale-cluster