Serialport
See original GitHub issueI’m encountering errors when trying to include the node serialport library in this framework. I’m working in a Windows environment. Below are the steps to reproduce the error:
git clone https://github.com/maximegris/angular-electron.git
cd angular-electron/
npm install
npm run electron:windows
The above launches as expected. But when serialport is installed and rebuilt then I encounter errors:
npm install serialport --save
In main.ts I add the following:
const serialport = require('serialport');
serialport.list((err, ports) => {
console.log('ports', ports);
});
And rebuild
npm run electron:windows
Error: The module ... was compiled against a different Node.js version using
NODE_MODULE_VERSION 47. This version of Node.js requires
NODE_MODULE_VERSION 70. Please try re-compiling or re-installing
the module (for instance, using `npm rebuild` or `npm install`).
I’ve tried several of the recommended solutions including modifying package.json but have had no luck. Everything works find when I simply run npm start
. Thoughts?
Issue Analytics
- State:
- Created 4 years ago
- Comments:6 (1 by maintainers)
Top Results From Across the Web
Node SerialPort: Home
Used in underwater sensors, drones, ATMs, fork lift diagnostics, and medical devices. SerialPort has found its way into many industries. With an Open...
Read more >serialport - npm
Node.js package to access serial ports. Linux, OSX and Windows. Welcome your robotic JavaScript overlords. Better yet, program them!
Read more >SerialPort Class (System.IO.Ports) - Microsoft Learn
This class provides synchronous and event-driven I/O, access to pin and break states, and access to serial driver properties. Additionally, the functionality of ......
Read more >SerialPort - Web APIs - MDN Web Docs
Chrome Edge
SerialPort. Experimental Full support. Chrome89. Toggle history Full support. Edge89...
close. Experimental Full support. Chrome89. Toggle history Full support. Edge89...
connect event. Experimental Full...
Read more >Node Serialport - GitHub
Access serial ports with JavaScript. Linux, OSX and Windows. Welcome your robotic JavaScript overlords. Better yet, program them! Go to https://serialport.io/ ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Try:
From https://serialport.io/docs/guide-installation#electron
#384