Hi, I am having a problem with serialport with johnnyfive. Just serial port works fine in electron, but with johnnyfive it throws an error:
was compiled against a different Node.js version using
NODE_MODULE_VERSION 115. This version of Node.js requires
NODE_MODULE_VERSION 116. Please try re-compiling or re-installing
the module (for instance, using `npm rebuild` or `npm install`).
at process.func [as dlopen] (node:electron/js2c/asar_bundle:2:2131)
at Object.<anonymous> (node:internal/modules/cjs/loader:1356:18)
at Object.func [as .node] (node:electron/js2c/asar_bundle:2:2131)
at Module.load (node:internal/modules/cjs/loader:1126:32)
at node:internal/modules/cjs/loader:967:12
at Function._load (node:electron/js2c/asar_bundle:2:13327)
at Module.require (node:internal/modules/cjs/loader:1150:19)
at require (node:internal/modules/cjs/helpers:110:18)
at bindings (.....\node_modules\bindings\bindings.js:112:48)
at Object.<anonymous> (.....\node_modules\@serialport\bindings\lib\win32.js:1:36)```
I have tried all node version to match module version, but seems that I cant get to 116. I've tried elecron-rebuild, npm rebuild.. nothing works.
package.json
```...
"dependencies": {
...
"ad-ngx-electron": "^3.0.0-beta.3",
"johnny-five": "^2.1.0",
"ngx-electron": "^2.2.0",
"rxjs": "~7.8.0",
"serialport": "^12.0.0",
"tslib": "^2.3.0",
"zone.js": "~0.13.0"
},
"devDependencies": {
...
"electron": "^26.6.9",
"electron-rebuild": "^3.2.9",
main.js
// this works fine
const { SerialPort } = require('serialport');
const port = new SerialPort({ path: 'COM4', baudRate: 9600 });
....
// this causes error
var five = require("johnny-five");
var board = new five.Board({ port: 'COM6'});
board.on("ready", function() {
...
});
....```
win10 64bit, node v 20.11.0
Thanks!