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

Builds fail on macOS with XCode 10 #1454

Closed
jhermsmeier opened this issue Jun 5, 2018 · 3 comments
Closed

Builds fail on macOS with XCode 10 #1454

jhermsmeier opened this issue Jun 5, 2018 · 3 comments
Labels

Comments

@jhermsmeier
Copy link
Contributor

  • Node Version: Node v10.3.0, npm v6.1.0
  • Platform: Darwin R2D2 17.6.0 Darwin Kernel Version 17.6.0: Tue May 8 15:22:16 PDT 2018; root:xnu-4570.61.1~1/RELEASE_X86_64 x86_64 i386 MacBookAir5,2 Darwin
  • Compiler:
Apple LLVM version 10.0.0 (clang-1000.10.25.5)
Target: x86_64-apple-darwin17.6.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin
Verbose output (from local npm install):
~/W/mountutils (master|ø) $ npm i

> mountutils@1.3.12 install /Users/Jonas/Work/mountutils
> prebuild-install || node-gyp rebuild

prebuild-install info begin Prebuild-install version 2.5.1
prebuild-install info install installing standalone, skipping download.
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

Traceback (most recent call last):
  File "/usr/local/n/versions/node/10.3.0/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py", line 16, in <module>
    sys.exit(gyp.script_main())
  File "/usr/local/n/versions/node/10.3.0/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/__init__.py", line 545, in script_main
    return main(sys.argv[1:])
  File "/usr/local/n/versions/node/10.3.0/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/__init__.py", line 538, in main
    return gyp_main(args)
  File "/usr/local/n/versions/node/10.3.0/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/__init__.py", line 523, in gyp_main
    generator.GenerateOutput(flat_list, targets, data, params)
  File "/usr/local/n/versions/node/10.3.0/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/make.py", line 2170, in GenerateOutput
    part_of_all=qualified_target in needed_targets)
  File "/usr/local/n/versions/node/10.3.0/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/make.py", line 795, in Write
    self.Pchify))
  File "/usr/local/n/versions/node/10.3.0/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/make.py", line 1190, in WriteSources
    cflags = self.xcode_settings.GetCflags(configname)
  File "/usr/local/n/versions/node/10.3.0/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/xcode_emulation.py", line 551, in GetCflags
    archs = self.GetActiveArchs(self.configname)
  File "/usr/local/n/versions/node/10.3.0/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/xcode_emulation.py", line 420, in GetActiveArchs
    xcode_archs_default = GetXcodeArchsDefault()
  File "/usr/local/n/versions/node/10.3.0/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/xcode_emulation.py", line 118, in GetXcodeArchsDefault
    xcode_version, _ = XcodeVersion()
  File "/usr/local/n/versions/node/10.3.0/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/xcode_emulation.py", line 1265, in XcodeVersion
    version = re.match(r'(\d\.\d\.?\d*)', version).groups()[0]
AttributeError: 'NoneType' object has no attribute 'groups'
gyp ERR! configure error
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onCpExit (/usr/local/n/versions/node/10.3.0/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:336:16)
gyp ERR! stack     at ChildProcess.emit (events.js:182:13)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:237:12)
gyp ERR! System Darwin 17.6.0
gyp ERR! command "/usr/local/bin/node" "/usr/local/n/versions/node/10.3.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/Jonas/Work/mountutils
gyp ERR! node -v v10.3.0
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! mountutils@1.3.12 install: `prebuild-install || node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the mountutils@1.3.12 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm http fetch POST 200 https://registry.npmjs.org/-/npm/v1/security/audits/quick 3442ms

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/Jonas/.npm/_logs/2018-06-05T12_24_37_170Z-debug.log
Output of /usr/sbin/pkgutil --pkg-info "com.apple.pkg.CLTools_Executables":
$ /usr/sbin/pkgutil --pkg-info com.apple.pkg.CLTools_Executables
package-id: com.apple.pkg.CLTools_Executables
version: 10.0.0.0.1.1527767617
volume: /
location: /
install-time: 1528194524
groups: com.apple.FindSystemFiles.pkg-group
@bnoordhuis
Copy link
Member

bnoordhuis commented Jun 5, 2018

Did you accept the EULA when installing xcode/xcode CLT? Running xcode-select or xcodebuild manually should prompt you.

edit: oh, I see you opened a PR just now. I'll have a look later today.

@jhermsmeier
Copy link
Contributor Author

Yup, made sure that wasn't the cause – turned out it's due to the version number matching regex, PRed a fix in #1455

@schnogz
Copy link

schnogz commented Jun 7, 2018

Seeing same issues running:

Node: v10.4.0
NPM: v6.1.0
Compiler:

Apple LLVM version 10.0.0 (clang-1000.10.25.5)
Target: x86_64-apple-darwin17.6.0
Thread model: posix InstalledDir: /Library/Developer/CommandLineTools/usr/bin

bnoordhuis pushed a commit that referenced this issue Jun 8, 2018
This fixes the regular expression matching in `xcode_emulation`
to also handle version numbers with multiple-digit major versions
which would otherwise break under use of XCode 10

Fixes: #1454
PR-URL: #1455
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Trott pushed a commit to Trott/npm that referenced this issue Jun 10, 2018
This fixes the regular expression matching in `xcode_emulation`
to also handle version numbers with multiple-digit major versions
which would otherwise break under use of XCode 10

Fixes: nodejs/node-gyp#1454
zkat pushed a commit to npm/npm that referenced this issue Jun 28, 2018
This fixes the regular expression matching in `xcode_emulation`
to also handle version numbers with multiple-digit major versions
which would otherwise break under use of XCode 10

Fixes: nodejs/node-gyp#1454
PR-URL: #20948
Credit: @Trott
Reviewed-By: @zkat
@cclauss cclauss added the gyp: No Xcode or CLT version detected! See: macOS_Catalina.md label May 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants