[英]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我正在使用electron 11.1.0 和电子生成器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我为我的 electron 应用程序创建了一个安装程序,该应用程序使用电子生成器的native module
,它在我的笔记本电脑上工作正常,但在我朋友的笔记本电脑上我收到错误
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.我检查了C:\some\path\My-Electron-App\resources\app.asar.unpacked\node_modules\obs-studio-node\obs_studio_client.node
文件是否存在。
I guess its asar
related issue with native module
.我猜它与native module
的asar
相关问题。 I tried by adding "asarUnpack": ["**/*.node"]
in my build
config but does not help.我尝试在我的build
配置中添加"asarUnpack": ["**/*.node"]
但没有帮助。
How can I fix this problem?我该如何解决这个问题?
I could not get this working with asarUnpack.我无法与 asarUnpack 一起工作。 Instead I use相反,我使用
"asar": false
Increases the bundle size, but at least it works.增加捆绑包的大小,但至少它可以工作。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.