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

Cannot install on Mac Mojave #158

Closed
sidu4u opened this issue Jun 23, 2021 · 3 comments
Closed

Cannot install on Mac Mojave #158

sidu4u opened this issue Jun 23, 2021 · 3 comments

Comments

@sidu4u
Copy link

sidu4u commented Jun 23, 2021

https://www.npmjs.com/package/mmmagic mentions node requirement as 4.0.0 or higher. However build fails on 8.11.0 or lower with error:

> mmmagic@0.5.3 install /Users/livspace/Projects/liv-home/node_modules/mmmagic
> node-gyp rebuild

gyp WARN download NVM_NODEJS_ORG_MIRROR is deprecated and will be removed in node-gyp v4, please use NODEJS_ORG_MIRROR
gyp WARN download NVM_NODEJS_ORG_MIRROR is deprecated and will be removed in node-gyp v4, please use NODEJS_ORG_MIRROR
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 "/Users/livspace/.nvm/versions/node/v8.11.0/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py", line 16, in <module>
    sys.exit(gyp.script_main())
  File "/Users/livspace/.nvm/versions/node/v8.11.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 "/Users/livspace/.nvm/versions/node/v8.11.0/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/__init__.py", line 538, in main
    return gyp_main(args)
  File "/Users/livspace/.nvm/versions/node/v8.11.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 "/Users/livspace/.nvm/versions/node/v8.11.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 "/Users/livspace/.nvm/versions/node/v8.11.0/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/make.py", line 795, in Write
    self.Pchify))
  File "/Users/livspace/.nvm/versions/node/v8.11.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 "/Users/livspace/.nvm/versions/node/v8.11.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 "/Users/livspace/.nvm/versions/node/v8.11.0/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/xcode_emulation.py", line 420, in GetActiveArchs
    xcode_archs_default = GetXcodeArchsDefault()
  File "/Users/livspace/.nvm/versions/node/v8.11.0/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/xcode_emulation.py", line 118, in GetXcodeArchsDefault
    xcode_version, _ = XcodeVersion()
  File "/Users/livspace/.nvm/versions/node/v8.11.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 (/Users/livspace/.nvm/versions/node/v8.11.0/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:336:16)
gyp ERR! stack     at emitTwo (events.js:126:13)
gyp ERR! stack     at ChildProcess.emit (events.js:214:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12)
gyp ERR! System Darwin 18.7.0
gyp ERR! command "/Users/livspace/.nvm/versions/node/v8.11.0/bin/node" "/Users/livspace/.nvm/versions/node/v8.11.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/livspace/Projects/liv-home/node_modules/mmmagic
gyp ERR! node -v v8.11.0
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok 
npm WARN browserify-shim@2.0.10 requires a peer of browserify@>= 2.3.0 < 4 but none is installed. You must install peer dependencies yourself.
npm WARN grunt-webpack@1.0.18 requires a peer of webpack@1.x but none is installed. You must install peer dependencies yourself.
npm WARN grunt-webpack@1.0.18 requires a peer of webpack-dev-server@1.x but none is installed. You must install peer dependencies yourself.
npm WARN liv-home@1.0.0 No repository field.
npm WARN liv-home@1.0.0 No license field.
npm WARN The package cli-color is included as both a dev and production dependency.
npm WARN The package less is included as both a dev and production dependency.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! mmmagic@0.5.3 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the mmmagic@0.5.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/livspace/.npm/_logs/2021-06-23T08_23_36_739Z-debug.log

tried installing older versions getting the same error for 0.2.5 as well

Note:
I read a similar issue here:#134. I am able to install mmmagic@0.5.3 on node@14.13.0. Is updating the node version the only solution?. (We have a common build environment and updating the node version may break other build.)

@mscdex
Copy link
Owner

mscdex commented Jun 23, 2021

You might check the macOS section of the node-gyp readme and perhaps the various solutions suggested in this node-gyp issue and see if any of those work.

My hunch is that there are several issues at play here and there are several ways to fix/workaround the issue. One of those solutions includes upgrading node-gyp, but I'm not sure if npm will use a globally installed copy of node-gyp if you decide to do that. However, this is why the install worked when you upgraded node because it was bundled with a newer version of node-gyp.

@itxtoledo
Copy link

same issue here

@mscdex
Copy link
Owner

mscdex commented Apr 29, 2022

Closing this as it's a node-gyp issue and nothing to do with mmmagic.

@mscdex mscdex closed this as completed Apr 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants