plotly / orca

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

Error: Cannot find module 'electron' #337

Open hadim opened 4 years ago

hadim commented 4 years ago

Related to https://github.com/plotly/orca/pull/73

Step to reproduce

conda install -y -c conda-forge plotly-orca==1.3.1

Running orca --help gives the following error:

internal/modules/cjs/loader.js:955
  throw err;
  ^

Error: Cannot find module 'electron'
Require stack:
- /opt/conda/lib/node_modules/orca/bin/orca.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:952:15)
    at Function.Module._load (internal/modules/cjs/loader.js:835:27)
    at Module.require (internal/modules/cjs/loader.js:1012:19)
    at require (internal/modules/cjs/helpers.js:72:18)
    at Object.<anonymous> (/opt/conda/lib/node_modules/orca/bin/orca.js:5:84)
    at Module._compile (internal/modules/cjs/loader.js:1123:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1143:10)
    at Module.load (internal/modules/cjs/loader.js:972:32)
    at Function.Module._load (internal/modules/cjs/loader.js:872:14)
    at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:71:12) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [ '/opt/conda/lib/node_modules/orca/bin/orca.js' ]
}

I also tried to conda install electron without success.

hadim commented 4 years ago

It actually works using the plotly channel. Would that be possible to sync the conda-forge package with your package?

https://github.com/conda-forge/plotly-orca-feedstock

Brunox13 commented 4 years ago

I had a similar problem - running orca --help produced the following error:

module.js:478
    throw err;
    ^

Error: Cannot find module 'electron'
    at Function.Module._resolveFilename (module.js:476:15)
    at Function.Module._load (module.js:424:25)
    at Module.require (module.js:504:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/Users/marek/opt/anaconda3/lib/node_modules/orca/bin/orca.js:5:84)
    at Module._compile (module.js:577:32)
    at Object.Module._extensions..js (module.js:586:10)
    at Module.load (module.js:494:32)
    at tryModuleLoad (module.js:453:12)
    at Function.Module._load (module.js:445:3)

It was fixed by installing plotly-orca using the following command:

conda install -c plotly plotly-orca==1.3.1

...which, I believe, is what @hadim meant by his comment above:

It actually works using the plotly channel. Would that be possible to sync the conda-forge package with your package?

ziober40 commented 3 years ago

what about solution when I am installing using npm/pip? I tried to install electron via npm but it doesn't work

nicolaskruchten commented 3 years ago

I'll just mention that we're basically replacing Orca with the new Kaleido project (https://github.com/plotly/Kaleido) which is significantly easier to install (i.e. it works with just pip!) and is our new recommended way forward for static image export :)

SunidhiGaonkar commented 2 years ago

Hi, I am facing the same issue, running orca --help gives the following error:

internal/modules/cjs/loader.js:626
    throw err;
    ^

Error: Cannot find module 'electron'
Require stack:
- /root/miniconda/lib/node_modules/orca/bin/orca.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:623:15)
    at Function.Module._load (internal/modules/cjs/loader.js:527:27)
    at Module.require (internal/modules/cjs/loader.js:681:19)
    at require (internal/modules/cjs/helpers.js:16:16)
    at Object.<anonymous> (/root/miniconda/lib/node_modules/orca/bin/orca.js:5:84)
    at Module._compile (internal/modules/cjs/loader.js:774:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:785:10)
    at Module.load (internal/modules/cjs/loader.js:641:32)
    at Function.Module._load (internal/modules/cjs/loader.js:556:12)
    at Function.Module.runMain (internal/modules/cjs/loader.js:837:10) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [ '/root/miniconda/lib/node_modules/orca/bin/orca.js' ]
}

I have already installed 'electron' and for the command conda install -c plotly plotly-orca==1.3.1 I get the following output:

Collecting package metadata (current_repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Collecting package metadata (repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.

PackagesNotFoundError: The following packages are not available from current channels:

  - plotly-orca==1.3.1

Current channels:

  - https://conda.anaconda.org/plotly/linux-ppc64le
  - https://conda.anaconda.org/plotly/noarch
  - https://repo.anaconda.com/pkgs/main/linux-ppc64le
  - https://repo.anaconda.com/pkgs/main/noarch
  - https://repo.anaconda.com/pkgs/r/linux-ppc64le
  - https://repo.anaconda.com/pkgs/r/noarch

To search for alternate channels that may provide the conda package you're
looking for, navigate to

    https://anaconda.org

and use the search bar at the top of the page.

so I had installed orca with conda install -y -c conda-forge plotly-orca==1.3.1 Is it possible to sync the orca from conda-forge package with plotly package?