Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Is this an Issue with MACOS catalina? #1927

Closed
joe-nano opened this issue Oct 16, 2019 · 190 comments · Fixed by #2686
Closed

Is this an Issue with MACOS catalina? #1927

joe-nano opened this issue Oct 16, 2019 · 190 comments · Fixed by #2686
Labels
gyp: No Xcode or CLT version detected! See: macOS_Catalina.md macOS Node Sass --> Dart Sass https://github.com/sass/node-sass/issues/2952 Python

Comments

@joe-nano
Copy link

joe-nano commented Oct 16, 2019

EDITED FOR PEOPLE JUST GETTING HERE:

node-gyp v7 should solve these issues.

Please follow the steps in macOS_Catalina.md

sha3@1.2.3 install /Users/drjosephdavids/node_modules/keccakjs/node_modules/sha3
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! I'M RUNNING XCODE 11.2beta
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:351:16)
gyp ERR! stack at ChildProcess.emit (events.js:198:13)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:248:12)
gyp ERR! System Darwin 19.0.0
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/drjosephdavids/node_modules/keccakjs/node_modules/sha3
gyp ERR! node -v v10.16.3
gyp ERR! node-gyp -v v5.0.5
gyp ERR! not ok
npm WARN enoent ENOENT: no such file or directory, open '/Users/drjosephdavids/package.json'
npm WARN drjosephdavids No description
npm WARN drjosephdavids No repository field.
npm WARN drjosephdavids No README data
npm WARN drjosephdavids No license field.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! sha3@1.2.3 install: node-gyp rebuild
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the sha3@1.2.3 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! /Users/drjosephdavids/.npm/_logs/2019-10-16T17_41_20_021Z-debug.log

  • Node Version:
  • Platform:
  • Compiler:
  • Module:
Verbose output (from npm or node-gyp):
Paste your log here, between the backticks. It can be:
  - npm --verbose output,
  - or contents of npm-debug.log,
  - or output of node-gyp rebuild --verbose.
@rvagg
Copy link
Member

rvagg commented Oct 16, 2019

gyp: No Xcode or CLT version detected! I'M RUNNING XCODE 11.2beta

Did you add that "I'M RUNNING XCODE 11.2beta" to the output? That may be the main problem, using a beta version of xcode. But you could also try installing the command-line tools to solve this: xcode-select --install and then sudo xcodebuild -license accept after that succeeds. gcc -v should show you have something like Apple clang version 11.0.0 (clang-1100.0.33.8).

@joe-nano
Copy link
Author

No I didn’t I was merely saying that I do have XCode installed

@mkellsy
Copy link

mkellsy commented Oct 16, 2019

I have the same issue

@rvagg
Copy link
Member

rvagg commented Oct 16, 2019

please try installing the commandline tools like I suggested, it's different to the full xcode

@mkellsy
Copy link

mkellsy commented Oct 16, 2019

When I run xcodebuild i get this

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

@mkellsy
Copy link

mkellsy commented Oct 16, 2019

When I run gcc -v I get this

Configured with: --prefix=/Library/Developer/CommandLineTools/usr --with-gxx-include-dir=/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/c++/4.2.1
Apple clang version 11.0.0 (clang-1100.0.32.5)
Target: x86_64-apple-darwin19.0.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin

@richardlau
Copy link
Member

When I run xcodebuild i get this

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

See #569.

@mkellsy
Copy link

mkellsy commented Oct 17, 2019

Thanks that works. I will let my users know.

@cclauss cclauss added the Python label Oct 19, 2019
@cclauss
Copy link
Contributor

cclauss commented Oct 19, 2019

@joe-nano Can this issue be closed?

@dreamerblue
Copy link

Same issue to me. node-gyp rebuild fails.

I'm using 10.15 Catalina and installed XCode CLI by xcode-select --install. But no com.apple.pkg.DeveloperToolsCLILeo, com.apple.pkg.DeveloperToolsCLI, com.apple.pkg.CLTools_Executables found.

image

Related source:

# This function ported from the logic in Homebrew's CLT version check
def CLTVersion():
"""Returns the version of command-line tools from pkgutil."""
# pkgutil output looks like
# package-id: com.apple.pkg.CLTools_Executables
# version: 5.0.1.0.1.1382131676
# volume: /
# location: /
# install-time: 1382544035
# groups: com.apple.FindSystemFiles.pkg-group com.apple.DevToolsBoth.pkg-group com.apple.DevToolsNonRelocatableShared.pkg-group
STANDALONE_PKG_ID = "com.apple.pkg.DeveloperToolsCLILeo"
FROM_XCODE_PKG_ID = "com.apple.pkg.DeveloperToolsCLI"
MAVERICKS_PKG_ID = "com.apple.pkg.CLTools_Executables"
regex = re.compile('version: (?P<version>.+)')
for key in [MAVERICKS_PKG_ID, STANDALONE_PKG_ID, FROM_XCODE_PKG_ID]:
try:
output = GetStdout(['/usr/sbin/pkgutil', '--pkg-info', key])
return re.search(regex, output).groupdict()['version']
except:
continue

Is there a way to fix it without installing full XCode.app?

@cclauss
Copy link
Contributor

cclauss commented Oct 20, 2019

sudo xcodebuild -license accept

@dreamerblue
Copy link

sudo xcodebuild -license accept cannot solve this problem without XCode.app.

Returns:

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

@naiba
Copy link

naiba commented Oct 21, 2019

sudo xcodebuild -license accept cannot solve this problem without XCode.app.

Returns:

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

Same issue.

@cclauss
Copy link
Contributor

cclauss commented Oct 21, 2019

Could I please get a few of you to run /usr/sbin/pkgutil --packages | grep CLTools on Catalina?
% /usr/sbin/pkgutil --packages | grep CLTools

com.apple.pkg.CLTools_Executables
com.apple.pkg.CLTools_SDK_macOS1015
com.apple.pkg.CLTools_SDK_macOS1014
com.apple.pkg.CLTools_macOS_SDK

If you get nothing returned, please do sudo xcode-select --install and then try the pkgutil command again.

@mkellsy
Copy link

mkellsy commented Oct 21, 2019

Could I please get a few of you to run /usr/sbin/pkgutil --packages | grep CLTools on Catalina?
% /usr/sbin/pkgutil --packages | grep CLTools

com.apple.pkg.CLTools_Executables
com.apple.pkg.CLTools_SDK_macOS1015
com.apple.pkg.CLTools_SDK_macOS1014
com.apple.pkg.CLTools_macOS_SDK

If you get nothing returned, please do xcode-select --install and then try the pkgutil command again.

It returns nothing

Last login: Sun Oct 20 15:22:02 on ttys002
mkellsy@mikes-laptop ~ % /usr/sbin/pkgutil --packages | grep CLTools
mkellsy@mikes-laptop ~ % 

Heres the same thing with grep Xcode

mkellsy@mikes-laptop ~ % /usr/sbin/pkgutil --packages | grep Xcode 
com.apple.pkg.XcodeSystemResources
com.apple.pkg.Xcode

When you try to install CLT

mkellsy@mikes-laptop ~ % xcode-select --install
xcode-select: error: command line tools are already installed, use "Software Update" to install updates
mkellsy@mikes-laptop ~ % 

@mkellsy
Copy link

mkellsy commented Oct 21, 2019

This worked for me.

  1. Install full Xcode
  2. Open Xcode and the CLT will install
  3. Then run sudo xcode-select -s /Applications/Xcode.app/Contents/Developer

This uses the full Xcode CLT and node-gyp works.

@cclauss
Copy link
Contributor

cclauss commented Oct 21, 2019

OK. Thanks. The goal is NOT to install full Xcode. Perhaps we needed to sudo on the xcode-select --install command. Did you look in "Software Update" to see if there was something there?

@lozinsky
Copy link

lozinsky commented Oct 21, 2019

Uninstalling command-line tools as described in the official documentation, then run xcode-select --install solves this problem for me.

@mkellsy
Copy link

mkellsy commented Oct 21, 2019

OK. Thanks. The goal is NOT to install full Xcode. Perhaps we needed to sudo on the xcode-select --install command. Did you look in "Software Update" to see if there was something there?

Yep, only Xcode.

For my Mac users, I am directing them to install full Xcode. Our team finds the instructions much easier then this https://developer.apple.com/library/archive/technotes/tn2339/_index.html.

Note that many of our users will not go to the Apple developer site. However they can tolerate a command here and there.

@matt17r
Copy link

matt17r commented Oct 22, 2019

If you get nothing returned, please do sudo xcode-select --install and then try the pkgutil command again.

On Catalina with command line tools (but no Xcode) I'm getting the same as others:

  • nothing found by /usr/sbin/pkgutil --packages | grep CLTools
  • trying to install CLT again gives me xcode-select: error: command line tools are already installed, use "Software Update" to install updates
  • no updates available in Software Update
  • lozinsky's suggestion didn't work for me (no change to the above points after deleting /Library/Developer/CommandLineTools and reinstalling with xcode-select --install)

Naïve question: Is there a reason the script needs to know the version? Is it not enough to just check the install location that they are installed with xcode-select -p (c.f. https://stackoverflow.com/a/15371967)?

@matt17r
Copy link

matt17r commented Oct 22, 2019

The comment says this check was ported from Homebrew:

# This function ported from the logic in Homebrew's CLT version check

FWIW, in macOS 10.14 and greater Homebrew checks whether CLT need to be installed based on the presence of git:
https://github.com/Homebrew/install/blob/9f9e98f9cb2f82030e018a65a489e6726999d136/install#L116-L123

@cclauss
Copy link
Contributor

cclauss commented Oct 22, 2019

@nodejs/build This issue is difficult to debug at scale because Travis CI does not yet support Catalina macOS 10.15 https://docs.travis-ci.com/user/reference/osx/#macos-version

Is there another way to test these cases on Jenkins?

@Trott
Copy link
Member

Trott commented Oct 22, 2019

Is there another way to test these cases on Jenkins?

I think we'd need someone to set up a Catalina host at MacStadium. I think our most active MacStadium deployer might have been @gdams but I'm not sure they're active on the project anymore. Unless gdams jumps in here with a "Yeah, let me get that set up for you", more definitive word on whether this can happen easily/quickly will have to come from @rvagg or @mhdawson, I think. I'm guessing it's not easy or quick since we're always several versions behind on our macOS hosts in Jenkins. But again, I'm speculating.

@rvagg
Copy link
Member

rvagg commented Oct 22, 2019

Sadly no, so far we haven't even been able to get High Sierra on MacStadium. Image availability and other complications. We do have some new Mac infrastructure we're introducing (and managing ourselves unfortunately) but that's a work in progress.

Everything about this is hard.

Also, I'll be holding back my laptop from Catalina, I can't afford the chaos, so I can't even help figure this all out.

@cclauss
Copy link
Contributor

cclauss commented Oct 22, 2019

I edited the original post with the fix that @gibfahn added to #569.

@cclauss
Copy link
Contributor

cclauss commented Oct 22, 2019

@joe-nano, et al, Can we close this issue?

@suzck
Copy link

suzck commented Oct 1, 2020

I posted the solution in #1927 (comment) and not sure why people didn't take a look. I got a DOWN vote with that comment too.

because that isn't 'the' solution. Plenty of us have experienced that no amount of uninstalling and reinstalling the command line tools fixed anything at all until we manually removed files from the disk. It would seem that those of us who already had xcode and command line tools installed from some previous version of OS X had extra steps that were required to clean up whatever mess was causing the problems, even after installing the latest version of everything.

sudo rm -rf $(xcode-select -print-path) 
sudo rm -rf /Library/Developer/CommandLineTools
xcode-select --install

except this solution doesn't work for some people after last catalina update, and the only working solution that we found is to donwload it manually from apple website.

I did the manual download and I still can't get it working, and our pipelines are failing now too presumably because the build machines are using Catalina too

@jdmarshall
Copy link

@suzck There were a couple cases where it was recommended you reset the xcode-select path. Which version of xcode CLI
did you try to install manually?

@ghost
Copy link

ghost commented Oct 4, 2020

There's a failure mode where xcode-select refuses to install itself because it's already installed. Even if the install directory doesn't exist. Even if you delete the install directory.

Same here.
Damn catalina...

@inglkruiz
Copy link

I just had the same issue which is getting quite repetitive every time I update macOS. This worked for me:

  1. Run:
sudo rm -rf /Library/Developer/CommandLineTools
  1. Download Command Line Tools for Xcode 12 from https://developer.apple.com/download/more/ . Install it manually.

@tonimelismasalesforce
Copy link

I'm just metoo'ing on this issue as requested in the macOS_Catalina.md. Did all the steps, including manually deleting the developer tool directories and downloading the .dmg from Apple web site for XCode 12 command-line tools. Acid test runs correctly yet I get the build error.

Unfortunately I'm trying to work with a large open source project that hasn't apparently adopted node-gyp v7 yet so I'm stuck here.

@cclauss
Copy link
Contributor

cclauss commented Oct 9, 2020

@tonimelismasalesforce does the solution proposed in #2235 work?

@rvagg
Copy link
Member

rvagg commented Oct 14, 2020

I'd like confirmation from someone that #2235 (adding an xcode-select --reset before the xcode-select --install) is an actual improvement over the current suggested steps.

@kboedges
Copy link

Downloading it directly from https://developer.apple.com/download/more/ worked for me: Command Line Tools for Xcode 12.2 beta 3

@zoheiry
Copy link

zoheiry commented Oct 16, 2020

Uninstalling and reinstalling works, but I have to do this quite often and xCode is pretty large and takes ages to reinstall, there must be a better way than having to reinstall it every few days

@cclauss
Copy link
Contributor

cclauss commented Oct 16, 2020

Yes. #2235

@slikts
Copy link

slikts commented Oct 26, 2020

This is what worked for me: downloading the non-beta Command Line Tools for Xcode 12, deleting the existing directories, installing it and then running:

sudo xcode-select --switch /Library/Developer/CommandLineTools

Part of the confusion is that every version seems to use a different path. The non-beta path is as above, while the more recent ones are under either /Applications/Xcode.app or /Applications/Xcode-beta.app. Here's a script to select the existing directory automatically:

names=("/Library/Developer/CommandLineTools" "/Applications/Xcode-beta.app/Contents/Developer" "/Applications/Xcode.app/Contents/Developer")

for name in ${names[*]}; do
  if [[ -d $name ]]
  then
    echo Selecting $name
    sudo xcode-select --switch $name
  fi
done

@cclauss
Copy link
Contributor

cclauss commented Oct 26, 2020

#2244 which just landed works for me.

@mhusseini
Copy link

mhusseini commented Oct 29, 2020

#1927 (comment)

Sounds like an issue with xcode command line tool installation. Could this be a solution? https://trac.macports.org/wiki/ProblemHotlist#reinstall-clt

This worked for me.

@jrking365
Copy link

#1927 (comment)

Sounds like an issue with xcode command line tool installation. Could this be a solution? https://trac.macports.org/wiki/ProblemHotlist#reinstall-clt

This worked for me.

worked for me too

@jarodcg
Copy link

jarodcg commented Nov 6, 2020

Sounds like an issue with xcode command line tool installation. Could this be a solution? https://trac.macports.org/wiki/ProblemHotlist#reinstall-clt

Started getting "No receipt for 'com.apple.pkg.CLTools_Executables' found at '/' -npm" after opening Terminal following the Catalina 10.15.7 supplemental update - this solution fixed it great.

@aaroncraigongithub
Copy link

aaroncraigongithub commented Jan 15, 2021

Just wanted to comment that following the instructions for "I did all that" (https://github.com/nodejs/node-gyp/blob/master/macOS_Catalina.md#i-did-all-that-and-the-acid-test-still-does-not-pass--) resulted in a broken XCode installation.

The XCode.app file has been removed, but the App Store thinks it's still installed, so doesn't present an option to re-install.

To re-install, I had to manually delete the Xcode.app file from /Applications.

@ohbeep
Copy link

ohbeep commented Jan 29, 2021

OK. Thanks. The goal is NOT to install full Xcode. Perhaps we needed to sudo on the xcode-select --install command. Did you look in "Software Update" to see if there was something there?

Yep, only Xcode.

For my Mac users, I am directing them to install full Xcode. Our team finds the instructions much easier then this https://developer.apple.com/library/archive/technotes/tn2339/_index.html.

Note that many of our users will not go to the Apple developer site. However they can tolerate a command here and there.

This works for me after installing the Command Line Tools for Xcode from apple(https://developer.apple.com/downloads/index.action). I have this issue every time the command line tools was updated by Mac's system software update.

@armenzg
Copy link

armenzg commented Feb 10, 2021

Should this check still be in place for folks on Big Sur?

It seems that every so often when there's an update from Mac this comes back.
I followed the documentation to get me back into a good state. You can find my output and steps here.

@GalaxySciTech
Copy link

This worked for me.

  1. Install full Xcode
  2. Open Xcode and the CLT will install
  3. Then run sudo xcode-select -s /Applications/Xcode.app/Contents/Developer

This uses the full Xcode CLT and node-gyp works.

get sign

@goya
Copy link

goya commented Jun 4, 2021

i had this error when running it as a dependancy.

once i installed it globally

$ npm i -g node-gyp

it worked fine. hope this helps someone who doesnt want to re-download xcode.

@ketsapiwiq
Copy link

ketsapiwiq commented Aug 8, 2021

I had this error and tried everything except installing the whole XCode 7Go package.

  • I installed cmake.js, a node-gyp alternative and I can now npm install...
  • npm install --ignore-scripts seems to work also in my case but apparently it doesn't install everything.

@spiritcapsule
Copy link

spiritcapsule commented Jun 22, 2022

the acid test (https://github.com/nodejs/node-gyp/blob/main/macOS_Catalina.md#the-acid-test) fails every time because https://github.com/nodejs/node-gyp/raw/master/macOS_Catalina_acid_test.sh does not exist (404). The command should be:
curl -sL https://github.com/raw/nodejs/node-gyp/main/macOS_Catalina_acid_test.sh | bash

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
gyp: No Xcode or CLT version detected! See: macOS_Catalina.md macOS Node Sass --> Dart Sass https://github.com/sass/node-sass/issues/2952 Python
Projects
None yet
Development

Successfully merging a pull request may close this issue.