GoogleCloudPlatform / nodejs-getting-started

A tutorial for creating a complete application using Node.js on Google Cloud Platform
https://cloud.google.com/nodejs
Apache License 2.0
805 stars 382 forks source link

error in running node js script >> UnhandledPromiseRejectionWarning: [closed] #586

Closed robo1973 closed 1 year ago

robo1973 commented 1 year ago

I want to run a project on raspberry pi from this link https://hackaday.io/project/158256-hoverbot There are errors when I run Ask for help in improving the design to make it work thank you It uses nvm >> 8.17.0 motors.js>>> https://github.com/isabellesimova/Hoverbot/blob/master/src/hoverbot/motors.js

nfo: [Server] Writing logs to /home/pi/Hoverbot/hoverbot.log info: [Server] Listening on 8000 error: [Motors] Unexpected token / in JSON at position 0 (node:6121) UnhandledPromiseRejectionWarning: Error [ERR_UNHANDLED_ERROR]: Unhan dled error. ({ message: 'Error parsing status message' }) at Motors.emit (events.js:187:17) at ReadLineParser.Motors.parser.on (/home/pi/Hoverbot/src/hoverbot/motors.js :44:14) at ReadLineParser.emit (events.js:198:13) at addChunk (_stream_readable.js:288:12) at readableAddChunk (_stream_readable.js:265:13) at ReadLineParser.Readable.push (_stream_readable.js:224:10) at ReadLineParser.Transform.push (_stream_transform.js:151:32) at ReadLineParser._transform (/home/pi/Hoverbot/node_modules/parser-delimite r/delimiter.js:38:12) at ReadLineParser.Transform._read (_stream_transform.js:190:10) at ReadLineParser.Transform._write (_stream_transform.js:178:12) (node:6121) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1) (node:6121) [DEP0018] DeprecationWarning: Unhandled promise rejections are depre