I’m developing an Electron application that uses node-serialport, which is a native module. I have it working fine on my Ubuntu machine. However, I need to distribute this application to Windows computers. I’m having some trouble figuring out the right incantations to develop on Ubuntu 16.04, and then use electron-builder / electron-rebuild to generate an executable installer for Windows that builds and packages the node-serialport lib for Windows. Hoping someone here can help steer me in the right direction.
I have already tried putting node-serialport in my ./app/package.json and my ./package.json. I can build an executable installer for Windows no problem, but it’s clear to me that it’s bundling the node-serialport library built for linux because I’m getting console log errors in Windows that read something like:
%1 is not a valid Win32 application, but this only happens when I attempt to invoke node-serialport. Do I have to actually build the application on a Windows machine to make this work?