Skip to content

Desktop predev should ensure Electron OS binary exists #26204

@JackLuguibin

Description

@JackLuguibin

Description

After a fresh clone—or when bun/npm install runs without lifecycle scripts for electron—desktop predev can run while the OS-specific Electron binary was never downloaded. The electron package normally writes node_modules/electron/path.txt only after install.js / postinstall succeeds. When that file is missing, later steps fail in ways that look unrelated to Electron.

Expected: Either document that installs must allow scripts, or have predev run the same step proactively.

Proposal: Before copy-icons, build-node, etc., if packages/desktop/node_modules/electron/path.txt is absent (after resolving the real electron package directory), spawn node install.js with cwd set to that directory and exit non-zero if it fails.

Plugins

None — desktop package / contributor dev setup.

OpenCode version

Local workspace on dev branch (not tied to a single released app version).

Steps to reproduce

  1. Clone the repo or reinstall deps such that electron postinstall did not run (e.g. scripts disabled, or incomplete install).
  2. Confirm path.txt is missing under the resolved electron install path (Bun may symlink under node_modules/.bun/...).
  3. Run bun run dev:desktop from the repo root or bun run predev in packages/desktop.
  4. Observe downstream failures (e.g. electron-vite / missing binary) instead of a clear electron install error.

Screenshot and/or share link

N/A — environment-specific; no /share link.

Operating System

Linux (any OS when the Electron binary was not downloaded).

Terminal

N/A

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions