Reputation: 11
so i'm currently working on a node and i tried pm2 and nodemon for auto restarting my node when it crashe's but none of them has seemed to work fine for me. I'm going to pust some prints... [enter image description here][1]
I want node to restart when the follow error shows up
BEFORE ERROR: https://i.snag.gy/Idus9z.jpg
AFTER ERROR: https://i.snag.gy/9rIF2N.jpg
Upvotes: 0
Views: 409
Reputation: 26
we are commonly use node-dev and nodemon for auto restarting node server, Here we can seen that, error cause because of the object have not value. so it make undefined error. In your code bot.js file line 338 have one if condition , here you check an object value equal to 3. but that property cannot read. because they don't have any value. so please check that property properly assigned or not.
Node-dev is a development tool for Node.js that automatically restarts the node process when a file is modified
npm install -g node-dev
For run
node-dev file_name.js
Upvotes: 1