Notes

Fix Electron 42 App Error on First Run of pnpm dev

2026-06-27 #Electron

Problem Reproduction

When developing or cloning an Electron 42 app, after installing dependencies, you might encounter an Error: Electron uninstall error message when running pnpm dev for the first time:

1
2
3
4
pnpm install --frozen-lockfile
pnpm approve-builds

pnpm dev

Error Message

1
2
3
4
5
error during start dev server and electron app:
Error: Electron uninstall
at getElectronPath
...
...

Solution

You need to manually run the following command:

1
npx install-electron

Cause of the Problem

This is because, to mitigate supply chain attacks, Electron 42 no longer downloads itself via postinstall.

Electron 42: electron no longer downloads itself via postinstall script

You can run the following commands:

1
2
npm install electron --save-dev --ignore-scripts
npx install-electron
Comments
Share

Comments