Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

electron-builder installer: A JavaScript error occurred in the main process, Error: The specified module could not be found

I am using electron 11.1.0 and electron-builder 22.10.5

I created a installer for my electron app which is using native module using electron-builder and its working fine on my laptop but on my friends laptop I am getting error

A JavaScript error occurred in the main process

Uncaught Exception:
Error: The specified module could not be found.
\\?C:\some\path\My-Electron-App\resources\app.asar.unpacked\node_modules\obs-studio-node\obs_studio_client.node

I have checked C:\some\path\My-Electron-App\resources\app.asar.unpacked\node_modules\obs-studio-node\obs_studio_client.node file exists.

I guess its asar related issue with native module. I tried by adding "asarUnpack": ["**/*.node"] in my build config but does not help.

How can I fix this problem?

like image 348
Alok Avatar asked Jun 05 '26 20:06

Alok


1 Answers

I could not get this working with asarUnpack. Instead I use

"asar": false

Increases the bundle size, but at least it works.

like image 199
stoefln Avatar answered Jun 08 '26 09:06

stoefln



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!