livebook-dev / vega_lite

Elixir bindings for Vega-Lite

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Problems finding and invoking npm/vega-lite when rendering charts on Windows 10

baybars1223 opened this issue · comments

Issue:
We've been unable to render charts on Windows 10. As far as we can tell, there are two problems.

The first is that Windows doesn't seem to support invoking *.cmd files as executables. So when System.find_executable("npm") returns the path to npm.cmd and npm_bin tries to run it, it fails with an eaccess error. For *.cmd, my understanding is that it would have to be something like System.cmd('cmd.exe', ['/c', path | args]) instead.

The second is that getting the path to the correct vega-lite binary fails on windows because the executable name is hard-coded (vl2svg as opposed to vl2svg.cmd on Windows).

In both cases, it seems like there would have a to be an OS check before searching and/or invoking the executables.

Versions:
OS: Windows 10
Node: 12.13.1
NPM: 6.12.1
vega_lite: 0.1.3
canvas@2.9.1
vega@5.22.1
vega-lite@5.2.0

@baybars1223 can you please send a PR addressing those things? You can use :os.type() to get the OS. Thank you!

Closed in #28.