Open Edig opened 2 years ago
+1
+1
I also have this problem with electron-builder on Raspberry Pi. Electron-builder has no problem to build other native modules like https://github.com/fivdi/i2c-bus with package.json like
"scripts": {
...
"postinstall": "electron-builder install-app-deps"
},
I wonder if it's because serialport/bindings-cpp provided prebuilts/linux-arm/ and other platforms like Mac, so electron-builder won't consider it's necessary to build it from source.
To work around, I just "rm -f node_modules/@serialport" and "npm install serialport --build-from-source".
I also tried electron-rebuild. It created build/Release/.forge-meta but didn't build anything.
per https://github.com/serialport/node-serialport/issues/2619 cross building using electron-builder should now work correctly in electron-builder 24.5.1
SerialPort Version
10.4.0
Node Version
16.13.1
Electron Version
17.1.2
Platform
Mac - Monterey (12.3)
What steps will reproduce the bug?
npx electron-builder -w
withWhat happens?
When I update to
V10.4.0
it change from binding to binding-cpp and when building for windows it sticks in.• rebuilding native dependencies dependencies=@serialport/bindings-cpp@10.7.0 platform=win32 arch=x64
How to patch it
I manage to fix it, by changing
"@serialport/bindings-cpp": "10.7.0"
to"@serialport/bindings": "10.0.1"
in package.json of serialport.Note: V10.0.1 can be build, but when you run it, it says "Serialport is not a constructor" you need to upgrade minimum to 10.0.2 and after that version, the binding change to cpp