mochman/MMM-Swipe

Error on install inside electron-rebuild

Opened this issue · 3 comments

Hi,

after running sudo npm install --unsafe-perm via ssh in the MMM-Swipe directory on my Raspberry Pi, I am getting the following error:

> MMM-Swipe@1.1.1 postinstall /home/pi/MagicMirror/modules/MMM-Swipe
> electron-rebuild -e ../../node_modules/electron-prebuilt

An unhandled error occurred inside electron-rebuild
Unable to find electron-prebuilt's version number, either install it or specify an explicit version

Error: Unable to find electron-prebuilt's version number, either install it or specify an explicit version
    at _callee$ (/home/pi/MagicMirror/modules/MMM-Swipe/node_modules/electron-rebuild/lib/cli.js:74:17)
    at tryCatch (/home/pi/MagicMirror/modules/MMM-Swipe/node_modules/babel-runtime/node_modules/regenerator-runtime/runtime.js:63:40)
    at GeneratorFunctionPrototype.invoke [as _invoke] (/home/pi/MagicMirror/modules/MMM-Swipe/node_modules/babel-runtime/node_modules/regenerator-runtime/runtime.js:337:22)
    at GeneratorFunctionPrototype.prototype.(anonymous function) [as next] (/home/pi/MagicMirror/modules/MMM-Swipe/node_modules/babel-runtime/node_modules/regenerator-runtime/runtime.js:96:21)
    at GeneratorFunctionPrototype.tryCatcher (/home/pi/MagicMirror/modules/MMM-Swipe/node_modules/bluebird/js/release/util.js:16:23)
    at PromiseSpawn._promiseFulfilled (/home/pi/MagicMirror/modules/MMM-Swipe/node_modules/bluebird/js/release/generators.js:97:49)
    at /home/pi/MagicMirror/modules/MMM-Swipe/node_modules/bluebird/js/release/generators.js:201:15
    at Object.<anonymous> (/home/pi/MagicMirror/modules/MMM-Swipe/node_modules/electron-rebuild/lib/cli.js:197:4)
    at Module._compile (module.js:570:32)
    at Object.Module._extensions..js (module.js:579:10)
    at Module.load (module.js:487:32)
    at tryModuleLoad (module.js:446:12)
    at Function.Module._load (module.js:438:3)
    at Module.runMain (module.js:604:10)
    at run (bootstrap_node.js:393:7)
    at startup (bootstrap_node.js:150:9)
npm ERR! code ELIFECYCLE
npm ERR! errno 255
npm ERR! MMM-Swipe@1.1.1 postinstall: \`electron-rebuild -e ../../node_modules/electron-prebuilt\`
npm ERR! Exit status 255
npm ERR! 
npm ERR! Failed at the MMM-Swipe@1.1.1 postinstall script 'electron-rebuild -e ../../node_modules/electron-prebuilt'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the MMM-Swipe package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     electron-rebuild -e ../../node_modules/electron-prebuilt
npm ERR! You can get information on how to open an issue for this project with:
npm ERR!     npm bugs MMM-Swipe
npm ERR! Or if that isn't available, you can get their info via:
npm ERR!     npm owner ls MMM-Swipe
npm ERR! There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2017-04-06T10_03_32_184Z-debug.log

Node.js and npm are up-to-date.

After changing electron-rebuild -e ../../node_modules/electron-prebuilt in package.json to electron-rebuild -e ../../node_modules/electron things seem to work. At least I get no more errors. Additionally ´electron-prebuilt` seems to be deprecated.

I would like to push this change to the repo, but obviously I don't have write access.

Cheers,

Matthias

Had the same problem... no errors after replacing electron-rebuild -e ../../node_modules/electron

I had the error, later i came to know that i was using Yarn for installing electron and NPM for rebuild. That was causing the issue.