Help! 'electron ./build' throws Error: spawn ENOENT

Hello,

Can anyone help me with this error? I’m trying to run X-Core on Raspberry Pi 4B (Raspbian with official 64 bit kernel). npm install went fine, but when I try to start it I get this:

pi@rpi4b:~/x-core $ npm --production start
npm WARN npm npm does not support Node.js v10.15.2
npm WARN npm You should probably upgrade to a newer version of node as we
npm WARN npm can’t make any promises that npm will work with this version.
npm WARN npm Supported releases of Node.js are the latest release of 4, 6, 7, 8, 9.
npm WARN npm You can find the latest version at https://nodejs.org/

@ start /home/pi/x-core
electron ./build

events.js:174
throw er; // Unhandled ‘error’ event
^

Error: spawn /home/pi/x-core/node_modules/electron/dist/electron ENOENT
at Process.ChildProcess._handle.onexit (internal/child_process.js:240:19)
at onErrorNT (internal/child_process.js:415:16)
at process._tickCallback (internal/process/next_tick.js:63:19)
at Function.Module.runMain (internal/modules/cjs/loader.js:745:11)
at startup (internal/bootstrap/node.js:283:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:743:3)
Emitted ‘error’ event at:
at Process.ChildProcess._handle.onexit (internal/child_process.js:246:12)
at onErrorNT (internal/child_process.js:415:16)
[… lines matching original stack trace …]
at bootstrapNodeJSCore (internal/bootstrap/node.js:743:3)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @ start: electron ./build
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/pi/.npm/_logs/2020-02-04T21_11_28_967Z-debug.log

pi@rpi4b:~/x-core $ cat /home/pi/.npm/_logs/2020-02-04T21_11_28_967Z-debug.log

0 info it worked if it ends with ok
1 warn npm npm does not support Node.js v10.15.2
2 warn npm You should probably upgrade to a newer version of node as we
3 warn npm can’t make any promises that npm will work with this version.
4 warn npm Supported releases of Node.js are the latest release of 4, 6, 7, 8, 9.
5 warn npm You can find the latest version at https://nodejs.org/
6 verbose cli [ ‘/usr/bin/node’, ‘/usr/bin/npm’, ‘–production’, ‘start’ ]
7 info using npm@5.8.0
8 info using node@v10.15.2
9 verbose run-script [ ‘prestart’, ‘start’, ‘poststart’ ]
10 info lifecycle @~prestart: @
11 info lifecycle @~start: @
12 verbose lifecycle @~start: unsafe-perm in lifecycle true
13 verbose lifecycle @~start: PATH: /usr/share/npm/node_modules/npm-lifecycle/node-gyp-bin:/home/pi/x-core/node_modules/.bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/local/games:/usr/games
14 verbose lifecycle @~start: CWD: /home/pi/x-core
15 silly lifecycle @~start: Args: [ ‘-c’, ‘electron ./build’ ]
16 silly lifecycle @~start: Returned: code: 1 signal: null
17 info lifecycle @~start: Failed to exec start script
18 verbose stack Error: @ start: electron ./build
18 verbose stack Exit status 1
18 verbose stack at EventEmitter. (/usr/share/npm/node_modules/npm-lifecycle/index.js:283:16)
18 verbose stack at EventEmitter.emit (events.js:189:13)
18 verbose stack at ChildProcess. (/usr/share/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
18 verbose stack at ChildProcess.emit (events.js:189:13)
18 verbose stack at maybeClose (internal/child_process.js:970:16)
18 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)
19 verbose pkgid @
20 verbose cwd /home/pi/x-core
21 verbose Linux 4.19.93-v8+
22 verbose argv “/usr/bin/node” “/usr/bin/npm” “–production” “start”
23 verbose node v10.15.2
24 verbose npm v5.8.0
25 error code ELIFECYCLE
26 error errno 1
27 error @ start: electron ./build
27 error Exit status 1
28 error Failed at the @ start script.
28 error This is probably not a problem with npm. There is likely additional logging output above.
29 verbose exit [ 1, true ]

In a chroot with a pure 64bit system (Debian Testing) I get:

npm --production start

@ start /root/x-core
electron ./build

/root/x-core/node_modules/electron/dist/electron: error while loading shared libraries: libnss3.so: cannot open shared object file: No such file or directory
npm ERR! code ELIFECYCLE
npm ERR! syscall spawn
npm ERR! file sh
npm ERR! errno ENOENT
npm ERR! @ start: electron ./build
npm ERR! spawn ENOENT
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! /root/.npm/_logs/2020-02-05T01_31_42_603Z-debug.log

cat /root/.npm/_logs/2020-02-05T01_31_42_603Z-debug.log

0 info it worked if it ends with ok
1 verbose cli [ ‘/usr/bin/node’, ‘/usr/bin/npm’, ‘–production’, ‘start’ ]
2 info using npm@6.13.4
3 info using node@v10.17.0
4 verbose run-script [ ‘prestart’, ‘start’, ‘poststart’ ]
5 info lifecycle @~prestart: @
6 info lifecycle @~start: @
7 verbose lifecycle @~start: unsafe-perm in lifecycle true
8 verbose lifecycle @~start: PATH: /usr/share/npm/node_modules/npm-lifecycle/node-gyp-bin:/root/x-core/node_modules/.bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
9 verbose lifecycle @~start: CWD: /root/x-core
10 silly lifecycle @~start: Args: [ ‘-c’, ‘electron ./build’ ]
11 info lifecycle @~start: Failed to exec start script
12 verbose stack Error: @ start: electron ./build
12 verbose stack spawn ENOENT
12 verbose stack at ChildProcess. (/usr/share/npm/node_modules/npm-lifecycle/lib/spawn.js:48:18)
12 verbose stack at ChildProcess.emit (events.js:198:13)
12 verbose stack at maybeClose (internal/child_process.js:982:16)
12 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)
13 verbose pkgid @
14 verbose cwd /root/x-core
15 verbose Linux 4.19.93-v8+
16 verbose argv “/usr/bin/node” “/usr/bin/npm” “–production” “start”
17 verbose node v10.17.0
18 verbose npm v6.13.4
19 error code ELIFECYCLE
20 error syscall spawn
21 error file sh
22 error errno ENOENT
23 error @ start: electron ./build
23 error spawn ENOENT
24 error Failed at the @ start script.
24 error This is probably not a problem with npm. There is likely additional logging output above.
25 verbose exit [ 1, true ]

Ignore this: everything has been fixed running in a pure 64 bit system with the right packages installed.