树莓派配置 Node SerialPort 最简单的方式,直接 clone 官方示例。
在桌面创建一个文件夹 demo,并 cd 到 demo 文件夹,然后
git clone https://github.com/serialport/electron-serialport.git cd electron-serialport npm install npm start
{ "name": "electron-serialport", "version": "1.0.2", "description": "A minimal Electron application with node serialport", "main": "main.js", "scripts": { "start": "electron .", "install": "electron-rebuild" }, "repository": { "type": "git", "url": "git@github.com:serialport/electron-serialport.git" }, "keywords": [ "Electron", "quick", "start", "tutorial", "demo" ], "author": "GitHub", "license": "CC0-1.0", "devDependencies": { "electron": "^13.1.6", "electron-rebuild": "^2.3.5" }, "dependencies": { "serialport": "^9.2.0", "tableify": "^1.1.0" } }