gregsqueeb / consultDash

A program to read from a Nissan Consult port and display a dashboard. This was originally meant to be run on a raspberry pi and used as a dashboard
158 stars 54 forks source link

SerialPort in not a constructor #10

Closed rafalbrz71 closed 5 years ago

rafalbrz71 commented 6 years ago

Maybe you can help with this:

pi@raspberrypi:~/consultDash $ npm start

hello-world@ start /home/pi/consultDash node server.js

/home/pi/consultDash/server.js:10 var sp = new SerialPort('/dev/ttyUSB0', { baudrate: 9600 }); ^

TypeError: SerialPort is not a constructor at Object. (/home/pi/consultDash/server.js:10:12) at Module._compile (module.js:653:30) at Object.Module._extensions..js (module.js:664:10) at Module.load (module.js:566:32) at tryModuleLoad (module.js:506:12) at Function.Module._load (module.js:498:3) at Function.Module.runMain (module.js:694:10) at startup (bootstrap_node.js:204:16) at bootstrap_node.js:625:3 npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! hello-world@ start: node server.js npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the hello-world@ start script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in: npm ERR! /home/pi/.npm/_logs/2018-09-13T09_50_01_987Z-debug.log pi@raspberrypi:~/consultDash $

gregsqueeb commented 5 years ago

Hello, just realized that I did not specify the version of node that is required and if the version is too new the serialport package will not work. Try downgrading your node version to v5.12 and the serialport package should work