galaxyproject / galaxyproject/loom

Electron postinstall silently fails on Linux ARM64 / Node 24 — `npm start` errors with "Electron failed to install correctly"

Open
#148 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
14
Forks
12
Avg merge
6d 5h
Merged PRs (30d)
17

Description

**Environment**
- Host: NVIDIA Jetson, `aarch64`, Ubuntu 20.04 (kernel `5.10.120-tegra`)
- Node: v24.16.0 (via nvm)
- npm: 11.13.0
- Repo: loom 0.1.1, `app/` (Electron 41.2.1, electron-forge 7.11.1)

**Symptom**
`cd app && npm install` completes with no errors. `npm start` then fails:

```
An unhandled rejection has occurred inside Forge:
Error: Electron failed to install correctly, please delete node_modules/electron and try installing again
at getElectronPath (.../node_modules/electron/index.js:17:11)
```

`app/node_modules/electron/path.txt` is missing and `app/node_modules/electron/dist/` only contains an empty `locales/` directory — the Electron binary was never extracted. Deleting `node_modules/electron` and reinstalling reproduces the same end state.

**Root cause**
Electron's postinstall (`node_modules/electron/install.js`) downloads the archive via `@electron/get` (succeeds) and then calls `extract-zip` to unpack it. On Node 24 / Linux ARM64, the Promise returned by `extract-zip@2.0.1` never settles — it neither resolves nor rejects — so `install.js` exits 0 without extracting anything. Running the script with explicit unsettled-await detection confirms it:

```
Warning: Detected unsettled top-level await at .../extract-zip
await extract(zip, { dir: dist });
```

The zip itself downloads fine (~117 MB) and unzips cleanly with the system `unzip`.

**Workaround**
```bash
DIR=app/node_modules/electron
ZIP=$(ls ~/.cache/electron/*/electron-v*-linux-arm64.zip | head -1)
rm -rf "$DIR/dist" && mkdir -p "$DIR/dist"
unzip -q "$ZIP" -d "$DIR/dist"
[ -f "$DIR/dist/electron.d.ts" ] && mv -f "$DIR/dist/electron.d.ts" "$DIR/electron.d.ts"
printf electron > "$DIR/path.txt"
```

After this, `npm start` launches Electron normally.

**Possible fixes**
- Bump `electron` (newer versions ship a fixed `extract-zip` or use a different extractor).
- Document a supported Node range for `app/` in README — Node 20 LTS may avoid the issue.
- Add an `app/scripts/postinstall.sh` that verifies `path.txt`/`dist/electron` exist and re-extracts from cache if not.

Contributor guide

No contributing guide indexed for this repository

Research direction

Reproduce from app/ with npm install and npm start on Linux ARM64 with Node 24, then inspect node_modules/electron/install.js, path.txt, and dist/ alongside the extract-zip behavior. Review the possible dependency, README, and app/scripts/postinstall.sh fixes; done means installation produces the Electron binary and path.txt so npm start launches normally.

Written by the indexing model from the issue text.

Assessment

Tech stack
electron, node.js, typescript
Domain
build-system, desktop
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.