plotly / orca

Command line application for generating static images of interactive plotly charts
MIT License
296 stars 39 forks source link

npm + pip fails on Linux #238

Closed astrojuanlu closed 5 years ago

astrojuanlu commented 5 years ago

I tried following the official npm + pip installation instructions on Linux and apparently all went fine:

$ npm install electron@1.8.4 orca
npm WARN deprecated left-pad@1.3.0: use String.prototype.padStart()
npm WARN lifecycle The node binary used for scripts is /snap/bin/node but npm is using /snap/node/2369/bin/node itself. Use the `--scripts-prepend-node-path` option to include the path for the node binary npm was executed with.

> electron@1.8.4 postinstall /home/juanlu/Development/poliastro/poliastro-library/node_modules/electron
> node install.js

Downloading SHASUMS256.txt
[============================================>] 100.0% of 3.43 kB (3.43 kB/s)
npm WARN saveError ENOENT: no such file or directory, open '/home/juanlu/Development/poliastro/poliastro-library/package.json'
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN enoent ENOENT: no such file or directory, open '/home/juanlu/Development/poliastro/poliastro-library/package.json'
npm WARN poliastro-library No description
npm WARN poliastro-library No repository field.
npm WARN poliastro-library No README data
npm WARN poliastro-library No license field.

+ electron@1.8.4
+ orca@1.2.1
added 229 packages from 293 contributors and audited 473 packages in 126.428s
found 1 critical severity vulnerability
  run `npm audit fix` to fix them, or `npm audit` for details

I avoided -g though, because... Well, I don't know NPM well enough to confidently install anything globally. As a result of my ignorance I don't know where the binary is supposed to be, but I looked in ./node_modules/orca/bin/orca.sh and found a surprise:

$ cat node_modules/orca/bin/orca.sh 
#!/bin/bash
exec "/Applications/orca.app/Contents/MacOS/orca" "$@"

I'm a bit puzzled here. I understand that there are three alternative installation methods (conda, AppImage, and Docker) but just wanted to leave this here in case there's something wrong.

jonmmease commented 5 years ago

Hi @Juanlu001,

When installing orca through npm, the entry point script should be node_modules/orca/bin/orca.js. I think it is probably a mistake that this orca.sh script is included in the installation.

etpinard commented 5 years ago

I think it is probably a mistake that this orca.sh script is included in the installation.

good call, we should .npmignore it!

astrojuanlu commented 5 years ago

Thanks and sorry for the dumb issue, I'm not used to have .js files as executable :innocent:

antoinerg commented 5 years ago

Thanks and sorry for the dumb issue, I'm not used to have .js files as executable

Because is resolved, I'm closing this one.