(Please answer all 3)
A JavaScript error occurred in the main process
Uncaught Exception:
Error: \\?\C:\Users\MyUser\AppData\Local\Temp\4deb32d9-50e4.....bf7b.tmp.node is not a valid Wind32 application.

And I am using electron-builder to build my electron app with no errors and I already run electron-rebuild every time before building.
"serialport": "6.2.2"
"electron": "4.0.5"
"electron-builder": "20.34.0"
"electron-rebuild": "^1.8.4"
Is it working fine before packaging it on windows?
Thanks for reply. When I build electron on Windows it works fine. I am trying to use prebuild-install before build on Mac now but can't figured out some step, still working on it.
Your concern is not clear to me. Could you please elaborate your issue?
@iamsush OK, I will create a repository for reproduction on Github, thanks.
Ok, thanks.
Here is the testing repository: https://github.com/DonaldChiang/node-serialport-testing
yarn installyarn electron:build:windows on Macnode-serialport-testing Setup 0.1.0.exe to Windows and installAnd you can see this error
Thanks!
Even I have had this issue, to resolve it I established my code on windows machine and it worked fine.
(Quite possible because for windows, it needs windows-build-tools and other things, I am not sure of the cause but this resolves it)
Have a look at this issue, #966. Does this resolve yours?
Yes, I can build electron on Windows and it works fine on Windows. So now my question is:
Can I compile node-serialport on Mac(or Linux) that is for Windows? Or use prebuild to do this?
it look like I can only compile node-serialport on Windows if I want to build an electron app for Windows version
Is there any guide for setup prebuild or node-gyp for multiple platform build?
Thank you very much!
Even I am not sure of this, Let @reconbot reply to this.
I know there are electron build tools for cross platform building. (I have in the past built Linux windows and OS X from my OS X laptop) they wouldn’t be serialport specific.
Hi pitching in cause im also interested in bundling for multiple platforms / electron
I would expect that there is a way to use the precompiled binaries that are located here :
https://github.com/node-serialport/node-serialport/releases
and therefore avoid the need for cross-compilers or running the builds on multiple platforms.
That is also mentioned in the docs 'We use prebuild to compile and post binaries of the library for most common use cases (Linux, Mac, Windows on standard processor platforms). '
But I have not been able to find clear documtation on how to make use of the posted binaries.
is my understanding correct, and if so , can you post a sample of how to use the prebuilts ?
It’s used by the npm install process, we use the package named prebuild-install to download them. And the package named bindings to load them. I have no idea how to distribute electron apps without building them.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in a week no further activity occurs. Feel free continue the discussion or ask for a never-stale label to keep it open. If this is a support issue, consider sharing it on stack overflow to get more eyes on your problem.
I've run into this since trying to upgrade to Electron 5, for which there are no prebuilt packages. It looks like something between electron-builder calling node-gyp-rebuild and @serialport/bindings, something is not getting compiled.
https://github.com/electron-userland/electron-builder/issues/3660 has some details, e.g. here's the result of rebuilding:
-rwxr-xr-x 1 danni staff 201072 19 Jun 13:02 usb/build/Release/usb_bindings.node
-rwxr-xr-x 1 danni staff 885752 19 Jun 13:02 iltorb/build/Release/iltorb.node
-rwxr-xr-x 1 danni staff 55244 **28 Apr 00:58** @serialport/bindings/build/Release/bindings.node
https://github.com/electron-userland/electron-builder/issues/4012 has a debug log:
• rebuilding native dependencies dependencies=@serialport/[email protected], [email protected], [email protected] platform=darwin arch=x64
• map async taskCount=3
• rebuilding native dependency name=@serialport/bindings version=2.0.8
• rebuilding native dependency name=iltorb version=2.4.3
• execute command command=/usr/local/Cellar/node/12.3.1/bin/node /usr/local/Cellar/yarn/1.16.0/libexec/bin/yarn.js run install workingDirectory=/Users/danni/src/SPT/spt-bridge/node_modules/iltorb
• execute command command=/usr/local/Cellar/node/12.3.1/bin/node /usr/local/Cellar/yarn/1.16.0/libexec/bin/yarn.js run install
workingDirectory=/Users/danni/src/SPT/spt-bridge/node_modules/@serialport/bindings
• command executed executable=/usr/local/Cellar/node/12.3.1/bin/node out=yarn run v1.16.0
$ prebuild-install --tag-prefix @serialport/bindings@ || node-gyp rebuild
Done in 0.27s.
I have the same issue with Electron 6, did you solve it @danni ?
I haven't come back to it yet, sorry.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in a week no further activity occurs. Feel free continue the discussion or ask for a never-stale label to keep it open. If this is a support issue, consider sharing it on stack overflow to get more eyes on your problem.
I don't know if anything changed in the most recent update, but the most recent update permitted me to upgrade to Electron 6.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed in a week no further activity occurs. Feel free continue the discussion or ask for a never-stale label to keep it open. If this is a support issue, consider sharing it on stack overflow to get more eyes on your problem.
Most helpful comment
I don't know if anything changed in the most recent update, but the most recent update permitted me to upgrade to Electron 6.