fix(deps): pin electron to ^41 to restore postinstall binary fetch (#584) (#586)

electron@42.0.0 (published 2026-05-06) removed the postinstall script
that downloads the prebuilt binary into node_modules/electron/dist.
Without dist/ the existence check in setup_electron_asar fails and the
build aborts with "Failed to find Electron distribution directory".

Pin to electron@^41 as a hotfix to unblock source builds. A durable
fix using @electron/get to fetch the binary explicitly will land
separately so we no longer depend on electron's postinstall behavior.

Refs #584

Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Claude <claude@anthropic.com>
This commit is contained in:
Aaddrick
2026-05-06 09:15:12 -04:00
committed by GitHub
parent a2411b8928
commit f7c4daeb89

View File

@@ -215,7 +215,11 @@ setup_electron_asar() {
if [[ $install_needed == true ]]; then
echo "Installing Electron and Asar locally into $work_dir..."
if ! npm install --no-save electron @electron/asar; then
# Pin to electron 41.x: electron@42.0.0 (2026-05-06) dropped the
# postinstall that fetches the prebuilt binary into dist/, leaving
# node_modules/electron/dist absent and the build aborting (#584).
# A durable fix using @electron/get is tracked separately.
if ! npm install --no-save 'electron@^41' @electron/asar; then
echo 'Failed to install Electron and/or Asar locally.' >&2
cd "$project_root" || exit 1
exit 1