electron调用dll问题总汇
通过一天的调试安装,electron调用dll成功,先列出当前的环境:
node版本:
18.12.0,32位的(因为dll为32位的)

VS2019
python

node-gyp

1、首先要查看报错原因,通常在某一行会有提示,常见报错:python版本问题,需要看报错信息是否升级版本。
2、电脑必须安装VS,我的电脑版本是VS2019。
3.安装ffi-napi之前,必须要全局安装node-gyp
npm i -g node-gyp rebuild
安装失败的话,升级下npm,或者缺少python环境,还是报错的话,下方留言。
4、启动electron时候,报错:electron: --openssl-legacy-provider is not allowed in NODE_OPTIONS
类似这个报错:需要升级node版本。
5、如果您的dll是32位的,需要使用32位的node安装electron,通过如下命令把electron集成到vue项目中(vue版本是2.0):
vue add electron-builder