Homebridge: AttributeError: 'NoneType' object has no attribute 'groups'

Created on 8 Jul 2018  路  4Comments  路  Source: homebridge/homebridge

Expected Behavior


Can't install on High Sierra Mac.

Current Behavior


Steps to Reproduce (for bugs)

  1. Follow instructions here
  2. Run step npm -g install homebridge --unsafe-perm, get following error:
mini:~ Coneybeare$ npm -g install homebridge --unsafe-perm
/usr/local/bin/homebridge -> /usr/local/lib/node_modules/homebridge/bin/homebridge

> [email protected] install /usr/local/lib/node_modules/homebridge/node_modules/curve25519-n
> 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

Traceback (most recent call last):
  File "/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py", line 16, in <module>
    sys.exit(gyp.script_main())
  File "/usr/local/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/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/__init__.py", line 538, in main
    return gyp_main(args)
  File "/usr/local/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/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/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/make.py", line 795, in Write
    self.Pchify))
  File "/usr/local/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/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/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/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/xcode_emulation.py", line 118, in GetXcodeArchsDefault
    xcode_version, _ = XcodeVersion()
  File "/usr/local/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/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/Cellar/node/10.6.0/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /usr/local/lib/node_modules/homebridge/node_modules/curve25519-n
gyp ERR! node -v v10.6.0
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok 
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] 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/Coneybeare/.npm/_logs/2018-07-08T17_26_56_035Z-debug.log

Versions

  • Homebridge: cannot get installed
  • Node: v10.6.0 installed via brew
  • OS: Mac mini running 10.13.5

Most helpful comment

This works for me

npm install -g n
n 8.8.1

sudo npm explore npm -g -- npm install node-gyp@latest

All 4 comments

You need to install XCode and then the Commandlinetools for XCode ... these are needed buildtools for many node modules not only homebridge dependecies.

Xcode already installed: Version 9.4.1 (9F2000)
Commandline tools installed: Command Line Tools (macOS 10.13) for Xcode 10 Beta 2

Ah, just typing out the last comment made me realize my Command Line Tools were mismatched with my Xcode. Downloaded CLT for Xcode 9 and all set.

This works for me

npm install -g n
n 8.8.1

sudo npm explore npm -g -- npm install node-gyp@latest

Was this page helpful?
0 / 5 - 0 ratings

Related issues

khazaee picture khazaee  路  3Comments

morilm picture morilm  路  6Comments

dkrizic picture dkrizic  路  6Comments

d0n13 picture d0n13  路  5Comments

StefanMeGit picture StefanMeGit  路  4Comments