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

Build errors, on Ubuntu under WSL in windows 10 #800

Closed
fregas opened this issue Jun 3, 2020 · 1 comment
Closed

Build errors, on Ubuntu under WSL in windows 10 #800

fregas opened this issue Jun 3, 2020 · 1 comment

Comments

@fregas
Copy link

fregas commented Jun 3, 2020

Are there any known issues around using Ubuntu on WSL? I am getting the following error when trying to install or update this package under WSL.

I'm on Ubuntu 20.04 LTS

npm install node-rdkafka

> node-rdkafka@2.8.1 install /mnt/d/Documents/video_event_notification_service/node_modules/node-rdkafka
> node-gyp rebuild

Traceback (most recent call last):
  File "/home/fregas/.asdf/installs/nodejs/12.13.0/lib/node_modules/npm/node_modules/node-gyp/gyp/gyp_main.py", line 50, in <module>
    sys.exit(gyp.script_main())
  File "/home/fregas/.asdf/installs/nodejs/12.13.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/fregas/.asdf/installs/nodejs/12.13.0/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/__init__.py", line 547, in main
    return gyp_main(args)
  File "/home/fregas/.asdf/installs/nodejs/12.13.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/fregas/.asdf/installs/nodejs/12.13.0/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/make.py", line 2214, in GenerateOutput
    writer.Write(qualified_target, base_path, output_file, spec, configs,
  File "/home/fregas/.asdf/installs/nodejs/12.13.0/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/make.py", line 793, in Write
    self.WriteActions(spec['actions'], extra_sources, extra_outputs,
  File "/home/fregas/.asdf/installs/nodejs/12.13.0/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/make.py", line 977, in WriteActions
    self.WriteDoCmd(outputs, [Sourceify(self.Absolutify(i)) for i in inputs],
  File "/home/fregas/.asdf/installs/nodejs/12.13.0/lib/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/generator/make.py", line 1720, in WriteDoCmd
    self.WriteMakeRule(outputs, inputs,
  File "/home/fregas/.asdf/installs/nodejs/12.13.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/fregas/.asdf/installs/nodejs/12.13.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 Linux 4.19.104-microsoft-standard
gyp ERR! command "/home/fregas/.asdf/installs/nodejs/12.13.0/bin/node" "/home/fregas/.asdf/installs/nodejs/12.13.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /mnt/d/Documents/video_event_notification_service/node_modules/node-rdkafka
gyp ERR! node -v v12.13.0
gyp ERR! node-gyp -v v5.0.5
gyp ERR! not ok
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.13 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.1.3 (node_modules/ndb/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! node-rdkafka@2.8.1 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the node-rdkafka@2.8.1 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/fregas/.npm/_logs/2020-06-03T15_06_31_247Z-debug.log

I have tried all the usual node-gyp fixes:
https://codeforgeek.com/make-failed-with-exit-code-2/

I was on WSL 1 but i upgraded to 2.0 and updated my Ubuntu distro. Still no luck.

I have (re)installed build-essential.

I removed 2.7.4 which is what we previously had working on linux/macos and tried upgrading to 2.8.0 and 2.8.1. Same errors.

If WSL just isn't really compatible then maybe i'm barking up the wrong tree.

@iradul
Copy link
Collaborator

iradul commented Jun 11, 2020

Duplicate #743

@iradul iradul closed this as completed Jun 11, 2020
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

2 participants