npm gyp error on Mojave
Does anyone know how to resolve errors like this?
I am trying to run 'npm i -S web3'
And I keep getting this error:
File "/usr/local/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/xcode_emul ation.py", line 1265, in XcodeVersion
version = re.match(r'(\d\.\d\.?\d*)', version).groups()[0]
AttributeError: 'NoneType' object has no attribute 'groups'
gypERR!configure error
gypERR!stack Error: `gyp` failed with exit code: 1
gypERR!stack at ChildProcess.onCpExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:336:16)
gypERR!stack at ChildProcess.emit (events.js:182:13)
gypERR!stack at Process.ChildProcess._handle.onexit (internal/child_process.js:225:12)
gypERR!System Darwin 18.0.0
gypERR!command "/usr/local/Cellar/node/10.0.0/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gypERR!cwd /usr/local/lib/node_modules/npm/node_modules/node-gyp/node_modules/scrypt
gypERR!node -v v10.0.0
gypERR!node-gyp -v v3.6.2
gypERR!not ok
npmERR!code ELIFECYCLE
npmERR!errno 1
npmERR! scrypt@6.0.3 install: `node-gyp rebuild`
npmERR! Exit status 1
npmERR!
npmERR! Failed at the scrypt@6.0.3 install script.
npmERR! This is probably not a problem with npm. There is likely additional logging output above.
npmERR! A complete log of this run can be found in:
npmERR! /Users/rsm/.npm/_logs/2018-10-24T05_39_01_620Z-debug.log
Others seem to be having the same or similar problems but I can't tell if there is a fix: https://github.com/nodejs/node-gyp/issues/1454
MacBook Pro TouchBar and Touch ID, macOS High Sierra (10.13.1), 15" 512GB 16GB RAM Radeon Pro 455