I`ve got some trouble with the electron. When I'm running my js code, it's working, but when i start electron with this code, it's not working
var i = 0
alert('1');
const SerialPort = require('serialport')
alert('1');
const Readline = SerialPort.parsers.Readline
const port = new SerialPort('/dev/pts/2')
const parser = new Readline()
port.pipe(parser)
parser.on('data',function (data)
{
console.log('Data:', data);
//DoSomeStuff(data);
//document.write(data);
})
function DoSomeStuff(data){
alert(data);
}
This code is reading what i'm writing in emulation of COM port and past in the console, and alert whats data i transfer from one port to another
Error
Uncaught Error: The module '/home/user/node_modules/@serialport/bindings/build/Release/bindings.node' was compiled against a different Node.js version using NODE_MODULE_VERSION 64. This version of Node.js requires NODE_MODULE_VERSION 70. Please try re-compiling or re-installing the module (for instance, using
npm rebuild
ornpm install
). at process.func [as dlopen] (electron/js2c/asar.js:155)...