Answer the question
In order to leave comments, you need to log in
How to solve TypeError [ERR_INVALID_CALLBACK]: Callback must be a function?
After executing these commands (Before these commands everything worked fine)
$ sudo npm cache clean -f
$ sudo npm install -g n
$ sudo n stable
TypeError [ERR_INVALID_CALLBACK]: Callback must be a function
TypeError [ERR_INVALID_CALLBACK]: Callback must be a function
1|bot | at maybeCallback (fs.js:128:9)
1|bot | at Object.appendFile (fs.js:1217:14)
1|bot | at Object.fallback (/usr/lib/node_modules/pm2/node_modules/pmx/node_modules/vxx/node_modules/continuation-local-storage/node_modules/async-listener/index.js:518:15)
1|bot | at Object.appendFile (/usr/lib/node_modules/pm2/node_modules/pmx/node_modules/vxx/node_modules/continuation-local-storage/node_modules/async-listener/index.js:542:53)
1|bot | at myconsolelog (/bot/bot.js:921:19)
1|bot | at Handshake._callback (/bot/bot.js:107:5)
1|bot | at Handshake.Sequence.end (/bot/node_modules/mysql/lib/protocol/sequences/Sequence.js:85:24)
1|bot | at Handshake.Sequence.OkPacket (/bot/node_modules/mysql/lib/protocol/sequences/Sequence.js:94:8)
1|bot | at Protocol._parsePacket (/bot/node_modules/mysql/lib/protocol/Protocol.js:280:23)
1|bot | at Parser.write (/bot/node_modules/mysql/lib/protocol/Parser.js:74:12)
function myconsolelog(text){
console.log(text);
require('fs').appendFile('bot_debug.log', text + "\r\n");
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question