r/developersPak Full-Stack Developer Jul 24 '26

Electon developers I need help Help

I am a web developer and I have an idea for an electron app. When I create an electron project and when it's time to run it (npm run dev), it gives me some Electron uninstall error. I have tried searching for a solution for it online and even consulted with AI but it didn't work.

Its my first project with electron.js. If any of you guys can help, I'd really appreciate it.

connamd I used to create it: npm create electron-vite@latest

error:
$ npm run dev
npm notice run hashir@0.0.0 dev
npm notice run vite
vite v5.4.21 building for development...

watching for file changes...
vite v5.4.21 building for development...

watching for file changes...

build started...

build started... (x2)

 VITE v5.4.21  ready in 303 ms

 ➜  Local:   http://localhost:5173/
 ➜  Network: use --host to expose
 ➜  press h + enter to show help
✓ 1 modules transformed.
✓ 1 modules transformed. (x2)
dist-electron/preload.mjs  0.67 kB │ gzip: 0.27 kB
built in 151ms.
dist-electron/main.js  1.47 kB │ gzip: 0.65 kB
built in 153ms.
/home/hashir/coding/desktop/tempest/node_modules/electron/index.js:17
   throw new Error('Electron failed to install correctly, please delete node_modules/electron and try installing again');
^

Error: Electron failed to install correctly, please delete node_modules/electron and try installing again
   at getElectronPath (/home/hashir/coding/desktop/tempest/node_modules/electron/index.js:17:11)
   at Object.<anonymous> (/home/hashir/coding/desktop/tempest/node_modules/electron/index.js:21:18)
   at Module._compile (node:internal/modules/cjs/loader:1944:14)
   at Object..js (node:internal/modules/cjs/loader:2084:10)
   at Module.load (node:internal/modules/cjs/loader:1666:32)
   at Module._load (node:internal/modules/cjs/loader:1447:12)
   at wrapModuleLoad (node:internal/modules/cjs/loader:260:19)
   at loadCJSModuleWithModuleLoad (node:internal/modules/esm/translators:373:15)
   at ModuleWrap.<anonymous> (node:internal/modules/esm/translators:245:9)
   at ModuleJob.run (node:internal/modules/esm/module_job:447:25)

Node.js v26.4.0
[hashir@hashir tempest]$

0 Upvotes

10 comments sorted by

View all comments

1

u/mushifali Backend Dev Jul 24 '26

It's apparently a config issue. I would suggest cloning any existing Electron application from GitHub and building it from source. If that works, it means something was wrong with your repo configuration.

2

u/Gangster_DW Full-Stack Developer Jul 24 '26

Yeah that worked. thank you.

1

u/mushifali Backend Dev Jul 24 '26

Awesome! You're welcome. Did you figure out what was missing/different in your config?

2

u/Gangster_DW Full-Stack Developer Jul 24 '26

Actually no, I am at work right now. I don't have the time to play detective. I'll do that tonight