Open
Conversation
… error electron-winstaller's postinstall tries to copy vendor/7z-arm.exe on ARM Linux, which fails because the file doesn't exist for Linux targets. Added --ignore-scripts to npm install and ELECTRON_SKIP_BINARY_DOWNLOAD=1 to prevent these Windows-only lifecycle hooks from running on Raspberry Pi. Also added npm prune --omit=dev after build to reclaim ~500 MB of disk space. Fixes: #<electron-winstaller ENOENT on Bullseye/ARM> Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
NodeSource dropped armhf support from Node.js 20 onwards, causing a hard failure on 32-bit Raspberry Pi OS (Bookworm/Bullseye). The official nodejs.org project still publishes armv7l tarballs for all LTS releases, so detect armhf via dpkg --print-architecture and download directly from nodejs.org/dist/latest-v22.x/ instead of using the NodeSource setup script. amd64 and arm64 continue to use NodeSource as before. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Piping curl directly into tar gives no opportunity to retry on a dropped connection, which is common when downloading the ~40 MB tarball over a flaky Pi network link. Save to a temp file first with --retry 3 so curl can re-attempt on transient failures, then extract separately so download and extraction errors are reported distinctly. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
Fix
setup-pi.shfailures on ARM / 32-bit Raspberry Pi OSProblem
Three cascading failures were reported by users running
setup-pi.shon ARM hardware:electron-winstallerENOENT on ARM —npm install --include=devinstallselectron-builder, which pulls inelectron-winstaller. Itspostinstallscript tries to copyvendor/7z-arm.exe → vendor/7z.exe. This Windows-only file does not exist on Linux targets, causing a hard failure. npm v10's rollback-on-failure behaviour then removesnode_modulesentirely, leaving the install in a broken state. [BUG] setup-pi.sh fails at step "npm install" #682NodeSource rejects 32-bit ARM (armhf) — NodeSource dropped
armhfsupport from Node.js 20 onwards. Running the NodeSource setup script on a 32-bit Raspberry Pi OS (Bookworm or Bullseye) produces:The script header claimed 32-bit support but never handled this case.
Fragile download on weak Pi connections — The initial armhf fix piped
curldirectly intotar. A single dropped connection mid-download resulted in a corrupt/partial extraction with no retry.Changes
scripts/setup-pi.shFix 1 — Skip harmful
postinstalllifecycle scripts duringnpm install--ignore-scriptsprevents all lifecycle hooks from running during install, specifically blockingelectron-winstaller'spostinstall. This is safe on a Pi because:npm run build(Vite) is an explicit call, unaffected by--ignore-scriptsprepare) are irrelevant on a production kioskA
npm prune --omit=devstep is added after the build to removeelectron,electron-builder, and related tooling (~500 MB) fromnode_moduleson the Pi.Fix 2 — Install Node.js from
nodejs.orgon 32-bit ARMinstall_nodejs()now detects architecture viadpkg --print-architecturebefore invoking NodeSource. Onarmhf, it falls back to the officialnodejs.orgarmv7ltarball, which Node.js continues to publish for all LTS releases including v22:amd64andarm64continue to use NodeSource unchanged.Fix 3 — Robust download with retry for the armv7l tarball
The ~40 MB tarball download is split into two discrete steps:
curldownloads to amktempfile with--retry 3 --retry-delay 5 --retry-connrefusedtarextracts from the file after a confirmed successful downloadDownload and extraction failures are reported separately, making future diagnosis easier.
Tested against
--kiosk--kioskRelated issues
electron-winstallerENOENT on ARM — reported by CM3/Bullseye userarmhfrejection — reported by Bookworm 32-bit usercurl | tarconnection reset — follow-up from same Bookworm 32-bit user