Electron-based Kiosk Snap

Thanks @ogra for your tips. It seems that I gave a little step further :grinning:… but the snap build failed.

After removing the architectures section from the initial yaml file. I tried to build the snap on snapcraft.io/build. (I tried the snapcraft remote build approach as well, and problems were exactly the same.)

Part of the build log is here:

WARN engine electron-notarize@1.0.0: wanted: {"node":">= 10.0.0"} (current: {"node":"8.10.0","npm":"3.5.2"})
WARN engine asar@3.0.3: wanted: {"node":">=10.12.0"} (current: {"node":"8.10.0","npm":"3.5.2"})
[17/Sep/2020:15:06:19 +0000] "CONNECT registry.npmjs.org:443 HTTP/1.1" 200 8810 "install electron electron-packager" "npm/3.5.2 node/v8.10.0 linux arm"
npm ERR! Linux 4.15.0-109-generic
npm ERR! argv "/usr/bin/node" "/usr/bin/npm" "install" "--unsafe-perm=true" "electron" "electron-packager"
npm ERR! node v8.10.0
npm ERR! npm  v3.5.2
npm ERR! code EMISSINGARG

npm ERR! typeerror Error: Missing required argument #1
npm ERR! typeerror     at andLogAndFinish (/usr/share/npm/lib/fetch-package-metadata.js:31:3)
npm ERR! typeerror     at fetchPackageMetadata (/usr/share/npm/lib/fetch-package-metadata.js:51:22)
npm ERR! typeerror     at resolveWithNewModule (/usr/share/npm/lib/install/deps.js:456:12)
npm ERR! typeerror     at /usr/share/npm/lib/install/deps.js:457:7
npm ERR! typeerror     at /usr/share/npm/node_modules/iferr/index.js:13:50
npm ERR! typeerror     at /usr/share/npm/lib/fetch-package-metadata.js:37:12
npm ERR! typeerror     at addRequestedAndFinish (/usr/share/npm/lib/fetch-package-metadata.js:82:5)
npm ERR! typeerror     at returnAndAddMetadata (/usr/share/npm/lib/fetch-package-metadata.js:117:7)
npm ERR! typeerror     at pickVersionFromRegistryDocument (/usr/share/npm/lib/fetch-package-metadata.js:134:20)
npm ERR! typeerror     at /usr/share/npm/node_modules/iferr/index.js:13:50
npm ERR! typeerror This is an error with npm itself. Please report this error at:
npm ERR! typeerror     <http://github.com/npm/npm/issues>
[17/Sep/2020:15:06:19 +0000] "CONNECT registry.npmjs.org:443 HTTP/1.1" 200 38633 "install electron electron-packager" "npm/3.5.2 node/v8.10.0 linux arm"
[17/Sep/2020:15:06:19 +0000] "CONNECT registry.npmjs.org:443 HTTP/1.1" 200 7063 "install electron electron-packager" "npm/3.5.2 node/v8.10.0 linux arm"
[17/Sep/2020:15:06:19 +0000] "CONNECT registry.npmjs.org:443 HTTP/1.1" 200 6753 "install electron electron-packager" "npm/3.5.2 node/v8.10.0 linux arm"
[17/Sep/2020:15:06:19 +0000] "CONNECT registry.npmjs.org:443 HTTP/1.1" 200 10257 "install electron electron-packager" "npm/3.5.2 node/v8.10.0 linux arm"
[17/Sep/2020:15:06:19 +0000] "CONNECT registry.npmjs.org:443 HTTP/1.1" 200 7525 "install electron electron-packager" "npm/3.5.2 node/v8.10.0 linux arm"
[17/Sep/2020:15:06:19 +0000] "CONNECT registry.npmjs.org:443 HTTP/1.1" 200 30808 "install electron electron-packager" "npm/3.5.2 node/v8.10.0 linux arm"
[17/Sep/2020:15:06:20 +0000] "CONNECT registry.npmjs.org:443 HTTP/1.1" 200 14286 "install electron electron-packager" "npm/3.5.2 node/v8.10.0 linux arm"
[17/Sep/2020:15:06:20 +0000] "CONNECT registry.npmjs.org:443 HTTP/1.1" 200 14872 "install electron electron-packager" "npm/3.5.2 node/v8.10.0 linux arm"
[17/Sep/2020:15:06:20 +0000] "CONNECT registry.npmjs.org:443 HTTP/1.1" 200 21870 "install electron electron-packager" "npm/3.5.2 node/v8.10.0 linux arm"
[17/Sep/2020:15:06:20 +0000] "CONNECT registry.npmjs.org:443 HTTP/1.1" 200 101394 "install electron electron-packager" "npm/3.5.2 node/v8.10.0 linux arm"
[17/Sep/2020:15:06:20 +0000] "CONNECT registry.npmjs.org:443 HTTP/1.1" 200 26640 "install electron electron-packager" "npm/3.5.2 node/v8.10.0 linux arm"
[17/Sep/2020:15:06:20 +0000] "CONNECT registry.npmjs.org:443 HTTP/1.1" 200 770198 "install electron electron-packager" "npm/3.5.2 node/v8.10.0 linux arm"

npm ERR! Please include the following file with any support request:
npm ERR!     /build/jbtest/parts/electron-helloworld/build/npm-debug.log
cp: cannot stat './electron-quick-start-linux-armv7l': No such file or directory
Failed to run 'override-build': Exit code was 1.
Build failed
Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/lpbuildd/target/build_snap.py", line 258, in run
    self.build()
  File "/usr/lib/python2.7/dist-packages/lpbuildd/target/build_snap.py", line 247, in build
    env=env)
  File "/usr/lib/python2.7/dist-packages/lpbuildd/target/build_snap.py", line 100, in run_build_command
    return self.backend.run(args, env=full_env, **kwargs)
  File "/usr/lib/python2.7/dist-packages/lpbuildd/target/lxd.py", line 537, in run
    subprocess.check_call(cmd, **kwargs)
  File "/usr/lib/python2.7/subprocess.py", line 190, in check_call
    raise CalledProcessError(retcode, cmd)
CalledProcessError: Command '['lxc', 'exec', 'lp-bionic-armhf', '--env', 'LANG=C.UTF-8', '--env', 'SHELL=/bin/sh', '--env', 'SNAPCRAFT_BUILD_INFO=1', '--env', 'SNAPCRAFT_IMAGE_INFO={"build-request-id": "lp-59239513", "build-request-timestamp": "2020-09-17T14:47:23Z", "build_url": "https://launchpad.net/~build.snapcraft.io/+snap/9ba49fc2fc7fef99b475d95896907e3d/+build/1120242"}', '--env', 'SNAPCRAFT_BUILD_ENVIRONMENT=host', '--env', 'http_proxy=http://10.10.10.1:8222/', '--env', 'https_proxy=http://10.10.10.1:8222/', '--env', 'GIT_PROXY_COMMAND=/usr/local/bin/snap-git-proxy', '--', '/bin/sh', '-c', 'cd /build/jbtest && linux32 snapcraft']' returned non-zero exit status 2
Revoking proxy token...
RUN: /usr/share/launchpad-buildd/bin/in-target scan-for-processes --backend=lxd --series=bionic --arch=armhf SNAPBUILD-1120242
Scanning for processes to kill in build SNAPBUILD-1120242

Any tip regarding these error messages? It seems to be related with node version…

I remember that I’m trying to complete an example on a RPi3. So I wasn’t expecting to face these problems.

Thanks

Note: For those of you who are following this thread and wondering what snapcraft remote build is, my suggestion is having a look to these links:

  1. Scrapcraft remote build video demonstration
  2. Scrapcraft remote build explanation