WebReflection / archibold.io

archibold.io
ISC License
86 stars 14 forks source link

Electron fails to install - default app won't start #10

Closed ubidefeo closed 4 years ago

ubidefeo commented 4 years ago

I am trying to track this one down. Setup goes well, it gets towards the end where I get an npm error related to serialport

Screenshot 2019-12-23 at 22 13 14

after setup is done I can restart the system and have it run off Ethernet but it will keep flashing the "Welcome to Arch Linux ARM" Not sure why it keeps reloading that way, but I can ssh into the system and check things out.

Screenshot 2019-12-23 at 22 19 05

I figure this system runs on ramfs and temporary RAM storage, so how would I go about switching to an updatable system I can work on before rebooting and make sure my changes stick?

ubidefeo commented 4 years ago

upon further investigation the issue really lies with electron's failure to install. npm start in the ~/app folder yields this error


> @ start /home/alarm/app
> electron --no-sandbox index.js

/usr/lib/node_modules/electron/index.js:14
    throw new Error('Electron failed to install correctly, please delete node_modules/electron and try installing again')
    ^

Error: Electron failed to install correctly, please delete node_modules/electron and try installing again
    at getElectronPath (/usr/lib/node_modules/electron/index.js:14:11)
    at Object.<anonymous> (/usr/lib/node_modules/electron/index.js:18:18)
    at Module._compile (internal/modules/cjs/loader.js:1139:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1159:10)
    at Module.load (internal/modules/cjs/loader.js:988:32)
    at Function.Module._load (internal/modules/cjs/loader.js:896:14)
    at Module.require (internal/modules/cjs/loader.js:1028:19)
    at require (internal/modules/cjs/helpers.js:72:18)
    at Object.<anonymous> (/usr/lib/node_modules/electron/cli.js:3:16)
    at Module._compile (internal/modules/cjs/loader.js:1139:30)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @ start: `electron --no-sandbox index.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @ start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/alarm/.npm/_logs/2019-12-24T09_45_53_655Z-debug.log

by scavenging the internet I found out that failure to install might be due to an architecture setting, hence I was able to install electron by npm i --arch=armv7l electron when in the user folder, but this won't work inside the app folder, because apparently npm is not able to modify a vfat fs.

that said, I see no way to move forward with the Rpi4. I will officially give up for now and try a Pi 3 :)

WebReflection commented 4 years ago

if that's the case, all you have to do is:

npm i -g --arch=armv7l electron

and it should work, but yeah, I rather put that within the installer, as it used to work, but it's clear that explicit is better than implicit.

WebReflection commented 4 years ago

added an if in the installation

if [ "$(uname -m)" = "aarch64" ]; then
  npm i -g electron
else
  npm i -g --arch=armv7l electron
fi
ubidefeo commented 4 years ago

totally fixed it, thank you @WebReflection :)