wavedrom / cli

CLI for WaveDrom

Home Page:https://wavedrom.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error when trying to run `wavedrom` CLI

kaushalmodi opened this issue · comments

Hello,

I ended up discovering this CLI form of wavedrom from this issue: wavedrom/wavedrom#161.

I did npm i -g wavedrom-cli --save-dev and it installed fine.

My npm version is 6.1.0.

When I typed just wavedrom, I got this error:

/home/kmodi/stowed/bin/wavedrom: line 1: /adlib: is a directory
/home/kmodi/stowed/bin/wavedrom: line 2: use strict: command not found
/home/kmodi/stowed/bin/wavedrom: line 4: syntax error near unexpected token `('
/home/kmodi/stowed/bin/wavedrom: line 4: `var fs = require('fs'),'`

Typing wavedrom -h, wavedrom --help gave the same error.

Please try v2.0.0

I just updated.. now I cannot use wavedrom-cli at all :(

I am on RHEL 6.8 (glibc v2.12), and wavedrom-cli depends on 2.14.

module.js:681
  return process.dlopen(module, path._makeLong(filename));
                 ^

Error: /lib64/libc.so.6: version `GLIBC_2.14' not found (required by /home/kmodi/stow/pkgs/node/8.11.1/lib/node_modules/wavedrom-cli/node_modules/canvas/build/Release/canvas.node)
    at Object.Module._extensions..node (module.js:681:18)
    at Module.load (module.js:565:32)
    at tryModuleLoad (module.js:505:12)
    at Function.Module._load (module.js:497:3)
    at Module.require (module.js:596:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/home/kmodi/stow/pkgs/node/8.11.1/lib/node_modules/wavedrom-cli/node_modules/canvas/lib/bindings.js:3:18)
    at Module._compile (module.js:652:30)
    at Object.Module._extensions..js (module.js:663:10)
    at Module.load (module.js:565:32)

Is it possible to reduce the glibc dependency?

Oh. great. I depend on this package: https://github.com/Automattic/node-canvas
They seem to have troubles with RHEL6,7 and you have to recompile canvas:

https://github.com/Automattic/node-canvas/wiki/Installation%3A-Fedora-and-other-RPM-based-distributions

could you try:

npm i wavedrom-cli --build-from-source=canvas

I tried:

npm i -g wavedrom-cli --save-dev --build-from-source=canvas

It's failing with:

../src/Image.h:18:10: fatal error: gif_lib.h: No such file or directory
   18 | #include <gif_lib.h>
      |          ^~~~~~~~~~~
compilation terminated.

I know that this is out of wavedrom territory, so will close this issue now.

sudo yum install gcc-c++ cairo-devel libjpeg-turbo-devel pango-devel giflib-devel

Let me know if you are able to solve it. I am really interested in making wavedrom-cli run in RHEL6

@drom I don't have sudo access on this machine. I do have giflib installed (It's used by my emacs installation). I am not familiar with node toolchain.. so not sure how to specify the LDFLAGS and CPPFLAGS like I do in C based projects.

Do you need PNGs or SVGs are fine?
Canvas required only for the generation of PNGs. I can try loading Canvas only when the user asks for PNGs.

Ooh! SVG are great! I actually prefer SVG over PNG because I don't like pixelated images :)

I can try loading Canvas only when the user asks for PNGs.

👍

please try wavedrom-cli v2.1.0

Now this works!

wavedrom-cli -i input.json -s output.svg

image

🎉

Thank you!!

Minor note.. if I do wavedrom-cli -i input.json, nothing happens (may be it should error out or create input.svg by default?)

Will STDOUT printing out SVG be good?

Yes, that will be nice.. then I could do wavedrom-cli input.json > output.svg.

Try v2.1.1

Thank you for the prompt turn arounds. I'm away from the computer now. I'll try out the update the first thing tomorrow.

@drom I confirm the update in v2.1.1. Thanks again.