fix: upgrade Electron for Node 24.16+/26 install compatibility#1352
Conversation
…atibility The previous preinstall guard blocked all Node >= 25 because Electron 40.8.0's extract-zip dependency (yauzl@2.x) silently fails on Node >= 24.16.0 due to a broken stream lifecycle in fd-slicer@1.x. Instead of forcing developers to manage Node versions, override yauzl to ^3.3.1 which bundles its own fixed fd-slicer. This is the same workaround used by serenity-js, shipshapecode/swach, and recommended in electron/electron#51619. The Node 25+ guard in check-node.mjs and its tests are removed. The format validation check is kept as a safety net. Related: electron/electron#51619, electron/electron#51886
📝 WalkthroughWalkthroughRemoves the Node version guard script ( ChangesCI Tooling Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Suggested labels
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Code Review
This pull request adds the yauzl dependency to package.json and removes the restriction preventing Node versions 25 and above from installing dependencies in script/check-node.mjs, updating the corresponding tests to allow Node 26. The reviewer suggests pinning the yauzl dependency to an exact version (3.3.1) instead of using a caret range to maintain consistency with other pinned dependencies and ensure reproducible builds.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
|
Warning Gemini encountered an error creating the review. You can try again by commenting |
- Delete script/check-node.mjs and script/check-node.test.mjs (P3) - Remove preinstall hook and test:install-guard script from package.json - Remove install guard unit step from CI workflow - Update bun.lock after adding yauzl override (P1) The yauzl@3.3.1 override fixes Electron's silent installation failure on Node >= 24.16.0. The Node version guard is no longer needed.
Add a pre-repair assertion in desktop-smoke that checks path.txt and Electron Framework.framework exist after bun install. This ensures the yauzl override is working — if it fails, CI will catch it before the repair step can mask the problem.
…ctronInstallComplete Replace the shell-based directory checks with a call to the repair script's exported isElectronInstallComplete function, which verifies: - The platform-specific Electron binary exists (dist/Electron.app/Contents/MacOS/Electron) - The Framework binary file exists (not just the directory) This prevents partially-damaged dist directories from passing the assertion and being silently masked by the repair step.
Add a check that path.txt exists and contains the expected macOS platform path 'Electron.app/Contents/MacOS/Electron'. This catches the #1329 failure mode where the binary and Framework were present but path.txt was missing.
…l matrix - Upgrade electron 40.8.0 → 40.10.3 (includes upstream extract-zip fix) - Remove yauzl override (no longer needed with Electron 40.10.3) - Add --assert-complete flag to repair-electron-install.mjs that checks binary, Framework, and path.txt content - Replace inline CI assertion with single-line --assert-complete call - Add install-matrix CI job covering Node 24 and 26 - Update PR description with migration guidance Related: electron/electron#51886, #1329
Summary
Fix Electron's silent installation failure on Node 24.16.0+ and 26.x by upgrading Electron from 40.8.0 to 40.10.3, which includes the upstream fix (electron/electron#51886) that replaces
extract-zipwith@electron-internal/extract-zip. Remove the now-unnecessary Node version guard.Why
PR #1346 added a
check-node.mjsguard that blockedbun installon Node ≥25. That guard was a workaround: the real issue isextract-zip→yauzl@2.x→fd-slicer@1.x, which has a broken stream lifecycle on newer Node versions, causing Electron's postinstall to silently skip binary extraction.Electron 40.10.3 includes the official fix (electron/electron#51886) that replaces
extract-zipentirely. This is cleaner than a transitive dependency override.Related Issue
bun run devcannot launch Electron inside a git worktree — dist binary is a 244K stub (vs 274M in main checkout) #1329 (worktree Electron install failure)Human Review Status
Pending
Review Focus
Check that Electron 40.10.3 upgrade doesn't introduce regressions, and that the CI install matrix covers both Node 24 and 26.
Risk Notes
@electron/getv5 upgrade.repair-electron-install.mjs --assert-completeflag is a new exported function that reuses existing internal checks. It does not change the repair flow.Migration for existing worktrees
If you have an existing worktree or local checkout with a broken Electron dist (244K stub, missing
path.txtorFrameworks):How To Verify
Screenshots or Recordings
Not applicable — CLI/install output only.
Checklist
bug,enhancement,task,documentation. Type labels are author-added; the labeler bot does NOT assign them. Add the label in the GitHub UI, then tick this.app,ui,platform,harness,ci. The labeler bot assigns these on PR open based on changed paths. Confirm the bot's choice (or override if wrong), then tick this.P0,P1,P2,P3. The priority-triage bot suggests one on PR open. Confirm or override, then tick this.Pending,Approved by @<reviewer>, orNot required: <reason>(default isPending; "not required" is restricted to bot-authored low-risk PRs).dev, and my PR title and commit messages use Conventional Commits in English.