Skip to content
This repository has been archived by the owner on Jun 6, 2021. It is now read-only.

node-gyp compilation issues with python 3 (version of [email protected]) #105

Open
davegermiquet opened this issue Jan 16, 2020 · 6 comments

Comments

@davegermiquet
Copy link

davegermiquet commented Jan 16, 2020

Problem:

Platform: Mac Os X (Version 10.14.6)
Python Version: Python 3.7.4
Node version: v12.14.0
node-gyp: gyp info using [email protected] (however i do have it set higher not sure why its choosing this one)
Yarn: v1.16.0,v1.21.1

On a yarn install this happens:


yarn install v1.16.0
[1/5] 🔍  Validating package.json...
[2/5] 🔍  Resolving packages...
[3/5] 🚚  Fetching packages...
[4/5] 🔗  Linking dependencies...
warning " > [email protected]" has unmet peer dependency "jquery@>=2.2.0".
warning " > [email protected]" has unmet peer dependency "what-input@>=4.1.0".
warning "gatsby > [email protected]" has unmet peer dependency "@types/react@^15.0.0 || ^16.0.0".
warning "gatsby > @typescript-eslint/eslint-plugin > [email protected]" has unmet peer dependency "typescript@>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta".
warning "gatsby > gatsby-cli > [email protected]" has unmet peer dependency "@types/react@>=16.8.0".
warning " > [email protected]" has incorrect peer dependency "onestart-foundation@git+https://github.kdc.capitalone.com/onestart/onestart-foundation.git#v2.2.1".
warning " > [email protected]" has unmet peer dependency "spray-cans@^4.0.0".
warning " > [email protected]" has unmet peer dependency "webpack@^4.35.3".
warning "gatsby-plugin-sass > [email protected]" has unmet peer dependency "webpack@^3.0.0 || ^4.0.0".
warning " > [email protected]" has incorrect peer dependency "react@^16.9.0".
warning " > [email protected]" has incorrect peer dependency "react-dom@^16.9.0".
warning " > [email protected]" has incorrect peer dependency "eslint@^4.19.1 || ^5.3.0".
warning " > [email protected]" has incorrect peer dependency "eslint@^4.19.1 || ^5.3.0".
warning " > [email protected]" has incorrect peer dependency "eslint@>=4 <6.0.0".
[5/5] 🔨  Building fresh packages...
[6/18] ⠂ node-sass
[14/18] ⠂ canvas
[7/18] ⠂ sharp
[-/18] ⠂ waiting...
error /Users/XXXXX/develop/XXXX/node_modules/iltorb: Command failed.
Exit code: 1
Command: node ./scripts/install.js || node-gyp rebuild
Arguments: 
Directory: /Users/XXXXXXXX/develop/XXXXXXXX/node_modules/iltorb
Output:
info looking for cached prebuild @ /Users/XXXXXXXX/.npm/_prebuilds/d152bd-iltorb-v2.4.3-node-v72-darwin-x64.tar.gz
http request GET https://github.com/MayhemYDG/iltorb/releases/download/v2.4.3/iltorb-v2.4.3-node-v72-darwin-x64.tar.gz
http request Proxy setup detected (Host:PROXY.HIDDEN, Port: 8099, Authentication: No) Tunneling with httpsOverHttp
WARN install self signed certificate in certificate chain
gyp info it worked if it ends with ok
gyp info using [email protected]
gyp info using [email protected] | darwin | x64
gyp info find Python using Python version 3.7.4 found at "/Users/XXXXXXXX/develop/XXXXXXXX/build_XXXXXXXX/bin/python"
gyp info spawn /Users/XXXXXXXX/develop/XXXXXXXX/build_XXXXXXXX/bin/python
gyp info spawn args [
gyp info spawn args   '/Users/XXXXXXXX/.nvm/versions/node/v12.14.0/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py',
gyp info spawn args   'binding.gyp',
gyp info spawn args   '-f',
gyp info spawn args   'make',
gyp info spawn args   '-I',
gyp info spawn args   '/Users/XXXXXXXX/develop/XXXXXXXX/node_modules/iltorb/build/config.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/Users/XXXXXXXX/.nvm/versions/node/v12.14.0/lib/node_modules/npm/node_modules/node-gyp/addon.gypi',
gyp info spawn args   '-I',
gyp info spawn args   '/Users/XXXXXXXX/Library/Caches/node-gyp/12.14.0/include/node/common.gypi',
gyp info spawn args   '-Dlibrary=shared_library',
gyp info spawn args   '-Dvisibility=default',
gyp info spawn args   '-Dnode_root_dir=/Users/XXXXXXXX/Library/Caches/node-gyp/12.14.0',
gyp info spawn args   '-Dnode_gyp_dir=/Users/XXXXXXXX/.nvm/versions/node/v12.14.0/lib/node_modules/npm/node_modules/node-gyp',
gyp info spawn args   '-Dnode_lib_file=/Users/XXXXXXXX/Library/Caches/node-gyp/12.14.0/<(target_arch)/node.lib',
gyp info spawn args   '-Dmodule_root_dir=/Users/XXXXXXXX/develop/XXXXXXXX/node_modules/iltorb',
gyp info spawn args   '-Dnode_engine=v8',
gyp info spawn args   '--depth=.',
gyp info spawn args   '--no-parallel',
gyp info spawn args   '--generator-output',
gyp info spawn args   'build',
gyp info spawn args   '-Goutput_dir=.'
gyp info spawn args ]
Traceback (most recent call last):
  File "/Users/XXXXXXXX/.nvm/versions/node/v12.14.0/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py", line 50, in <module>
    sys.exit(gyp.script_main())
  File "/Users/XXXXXXXX/.nvm/versions/node/v12.14.0/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/__init__.py", line 554, in script_main
    return main(sys.argv[1:])
  File "/Users/XXXXXXXX/.nvm/versions/node/v12.14.0/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/__init__.py", line 547, in main
    return gyp_main(args)
  File "/Users/XXXXXXXX/.nvm/versions/node/v12.14.0/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/__init__.py", line 532, in gyp_main
    generator.GenerateOutput(flat_list, targets, data, params)
  File "/Users/XXXXXXXX/.nvm/versions/node/v12.14.0/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/make.py", line 2215, in GenerateOutput
    part_of_all=qualified_target in needed_targets)
  File "/Users/XXXXXXXX/.nvm/versions/node/v12.14.0/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/make.py", line 802, in Write
    self.WriteCopies(spec['copies'], extra_outputs, part_of_all)
  File "/Users/XXXXXXXX/.nvm/versions/node/v12.14.0/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/make.py", line 1145, in WriteCopies
    env = self.GetSortedXcodeEnv()
  File "/Users/XXXXXXXX/.nvm/versions/node/v12.14.0/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/make.py", line 1885, in GetSortedXcodeEnv
    additional_settings)
  File "/Users/XXXXXXXX/.nvm/versions/node/v12.14.0/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/xcode_emulation.py", line 1616, in GetSortedXcodeEnv
    additional_settings)
  File "/Users/XXXXXXXX/.nvm/versions/node/v12.14.0/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/xcode_emulation.py", line 1527, in _GetXcodeEnv
    if XcodeVersion() >= '0500' and not env.get('SDKROOT'):
TypeError: '>=' not supported between instances of 'tuple' and 'str'
gyp ERR! configure error 
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onCpExit (/Users/XXXXXXXX/.nvm/versions/node/v12.14.0/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:351:16)
gyp ERR! stack     at ChildProcess.emit (events.js:210:5)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:272:12)
gyp ERR! System Darwin 18.7.0
gyp ERR! command "/Users/XXXXXXXX/.nvm/versions/node/v12.14.0/bin/node" "/Users/XXXXXXXX/.nvm/versions/node/v12.14.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/XXXXXXXX/develop/XXXXXXXX/node_modules/iltorb

How can we fix this issue?

@addaleax
Copy link
Contributor

@davegermiquet I’m not an expert on yarn, but does using npm or updating yarn help? At least npm ships with its own copy of node-gyp.

@davegermiquet
Copy link
Author

@davegermiquet I’m not an expert on yarn, but does using npm or updating yarn help? At least npm ships with its own copy of node-gyp.

I'll upgrade yarn now, is it a node-gyp version issue or a iltorb issue in compilation?

@addaleax
Copy link
Contributor

@davegermiquet I would be relatively sure that it’s the former.

@davegermiquet
Copy link
Author

@davegermiquet I would be relatively sure that it’s the former.

Ok. Same issue happens on latest version of yarn. Let me see if i can force a node-gyp version then.

@nstepien
Copy link
Owner

nstepien commented Feb 1, 2020

@davegermiquet is it still happening?

@davegermiquet
Copy link
Author

I was able resolve the issue by doing the following:

  • Using NVM
  • Upgrading to the latest version LTS (10 or 12) that supports python3 and node-gyp
  • upgrading the latest node-gyp to 6.1.0
    npm explore npm -g -- npm install node-gyp@latest

Also may need to use resolutions feature with yarn for package.json depending on the dependencies

see below:

"resolutions": {
"{package-name}/node-gyp": "^6.X.X"
},

Hope this helps someone until the complete upgrades of python3

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants