fs.js:149
State changed from up to crashed
throw new ERR_INVALID_CALLBACK(cb);
^
TypeError [ERR_INVALID_CALLBACK]: Callback must be a function. Received undefined
at makeCallback (fs.js:149:11)
at Object.unlink (fs.js:996:14)
at /app/anon.js:211:16
at /app/node_modules/twit/lib/twitter.js:127:13
at onRequestComplete (/app/node_modules/twit/lib/twitter.js:352:5)
at Request.<anonymous> (/app/node_modules/twit/lib/twitter.js:364:7)
at Request.emit (events.js:201:15)
at IncomingMessage.<anonymous> (/app/node_modules/request/request.js:1079:12)
at Object.onceWrapper (events.js:284:20)
at IncomingMessage.emit (events.js:201:15)
at endReadableNT (_stream_readable.js:1130:12)
at processTicksAndRejections (internal/process/task_queues.js:83:17)
Per the error, the problem was with line 211, which runs fs.unlink(screenshot). Looks like fs.unlink expects a second param (a callback), so fixed it by changing to fs.unlinkSync(screenshot).
Odd, I don't know why nobody has run into that before, and the test suite passes without it. Maybe something with Node versions? At any rate I applied your change.
Was getting the error below:
Per the error, the problem was with line 211, which runs
fs.unlink(screenshot)
. Looks likefs.unlink
expects a second param (a callback), so fixed it by changing tofs.unlinkSync(screenshot)
.