node 8.0+ python v2.7 vs stdudio c++2015/2017 node-gyp node-com https://github.com/nodebots/electron-serialport
查看dll 方法 vs -- cmd dumpbin /exports +dll路径
后台项目安装ffi注意事项 1、其他模块先安装 ffi安装失败的话(删除package.json中ffi依赖手动安装) npm install cnpm install ffi --save-dev (管理员权限)不然打包客户端打不进去
成功安装ffi模块 安装ref模块
重编译
调用64位dll
ffi、ref 模块下 cmd管理员权限运行
node-gyp rebuild --target=4.0.1 --arch=x64 --target_arch=x64 --dist-url=https://npm.taobao.org/mirrors/atom-shell
或者
node-gyp rebuild --target=4.0.1 --arch=x64 --target_arch=x64 --dist-url=https://atom.io/download/electron
target ---electron 版本号
调用32位dll
node 换成x32
node-gyp rebuild --target=4.0.1 --arch=ia32 --target_arch=ia32 --dist-url=https://npm.taobao.org/mirrors/atom-shell
或者一键编译
electron-builder install-app-deps
electron-rebuild