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

gyp rebuild fails during npm install (python3.7). #2064

Closed
sadvazha opened this issue Mar 9, 2020 · 4 comments
Closed

gyp rebuild fails during npm install (python3.7). #2064

sadvazha opened this issue Mar 9, 2020 · 4 comments

Comments

@sadvazha
Copy link

sadvazha commented Mar 9, 2020

Verbose output (from npm or node-gyp):
> node-rdkafka@2.7.0 install /home/scandal/work/pos-backend/node_modules/node-rdkafka
> node-gyp rebuild

Traceback (most recent call last):
  File "/home/scandal/.nvm/versions/node/v10.19.0/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py", line 50, in <module>
    sys.exit(gyp.script_main())
  File "/home/scandal/.nvm/versions/node/v10.19.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 "/home/scandal/.nvm/versions/node/v10.19.0/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/__init__.py", line 547, in main
    return gyp_main(args)
  File "/home/scandal/.nvm/versions/node/v10.19.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 "/home/scandal/.nvm/versions/node/v10.19.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 "/home/scandal/.nvm/versions/node/v10.19.0/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/make.py", line 794, in Write
    extra_mac_bundle_resources, part_of_all)
  File "/home/scandal/.nvm/versions/node/v10.19.0/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/make.py", line 978, in WriteActions
    part_of_all=part_of_all, command=name)
  File "/home/scandal/.nvm/versions/node/v10.19.0/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/make.py", line 1724, in WriteDoCmd
    force = True)
  File "/home/scandal/.nvm/versions/node/v10.19.0/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/make.py", line 1779, in WriteMakeRule
    cmddigest = hashlib.sha1(command if command else self.target).hexdigest()
TypeError: Unicode-objects must be encoded before hashing
gyp ERR! configure error 
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onCpExit (/home/scandal/.nvm/versions/node/v10.19.0/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:351:16)
gyp ERR! stack     at ChildProcess.emit (events.js:198:13)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:248:12)
gyp ERR! System Linux 4.15.0-88-generic
gyp ERR! command "/home/scandal/.nvm/versions/node/v10.19.0/bin/node" "/home/scandal/.nvm/versions/node/v10.19.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /home/scandal/work/pos-backend/node_modules/node-rdkafka
gyp ERR! node -v v10.19.0
gyp ERR! node-gyp -v v5.0.5
gyp ERR! not ok 
npm WARN @nestjs/cqrs@6.1.0 requires a peer of reflect-metadata@0.1.12 but none is installed. You must install peer dependencies yourself.
npm WARN pos-backend@0.0.1 No repository field.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.11 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.11: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! node-rdkafka@2.7.0 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the node-rdkafka@2.7.0 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!     /home/scandal/.npm/_logs/2020-03-09T10_19_19_581Z-debug.log

I could not install node-rdkafka module without setting PYTHON to v2.7. My current version of python is 3.7.1

@rvagg
Copy link
Member

rvagg commented Mar 10, 2020

@cclauss one for you I think? I can't see anything in https://github.com/Blizzard/node-rdkafka/blob/master/binding.gyp that suggests unicode is getting involved, other than the BUILD_LIBRDKAFKA environment variable possibly but it's only used to check for ==1. I also don't see any unicode in the paths here. 🤷‍♂

@cclauss
Copy link
Contributor

cclauss commented Mar 10, 2020

I believe that @dothebart nailed this one in #1925 which landed in v5.0.6.
v5.0.5 does not have this fix so I believe that npm/cli needs to do another gyp round trip.

@dothebart
Copy link
Contributor

yes, this stacktrace sounds familliar.

@sadvazha
Copy link
Author

Yep, works for me after updating npm

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

4 participants