Closed stephanschorer closed 1 year ago
Hi, thanks for opening an issue and letting me know that this error exists. I could reproduce the error and it seems to be fixed by using the built in readline module instead of stdout. I will have to tinker a bit with it because it seems to be working slightly different but it will definitely be included in the next version.
I will keep the issue open until the update is out.
Edit: readline.clearLine() is now working exactly like process.stdout.clearLine() worked before.
Should be fixed in commit 8adc902 (Version 2.7.2). Thanks again for opening this issue!
@HerrEurobeat hi I think this issue reoccurred :)
`
21:18:31 0|start | TypeError: process.stdout.moveCursor is not a function
21:18:31 0|start | at module.exports.log (/home/steam_commentbot/node_modules/output-logger/lib/helpers/printManager.js:80:24)
21:18:31 0|start | at module.exports.logger (/home/steam_commentbot/node_modules/output-logger/lib/logger.js:92:27)
21:18:31 0|start | at module.exports (/home/steam_commentbot/node_modules/output-logger/index.js:35:39)
21:18:31 0|start | at /home/steam_commentbot/src/starter.js:324:9
21:18:31 0|start | at attachParentListeners (/home/steam_commentbot/src/starter.js:136:5)
21:18:31 0|start | at module.exports.run (/home/steam_commentbot/src/starter.js:323:5)
21:18:31 0|start | at Object.
21:18:31 0|start | TypeError: process.stdout.moveCursor is not a function 21:18:31 0|start | at module.exports.log (/home/steam_commentbot/node_modules/output-logger/lib/helpers/printManager.js:80:24) 21:18:31 0|start | at module.exports.logger (/home/steam_commentbot/node_modules/output-logger/lib/logger.js:92:27) 21:18:31 0|start | at module.exports (/home/steam_commentbot/node_modules/output-logger/index.js:35:39) 21:18:31 0|start | at process.handleUnhandledRejection (/home/steam_commentbot/src/starter.js:55:9) 21:18:31 0|start | at process.emit (node:events:524:35) 21:18:31 0|start | at emit (node:internal/process/promises:150:20) 21:18:31 0|start | at processPromiseRejections (node:internal/process/promises:284:27) 21:18:31 0|start | at process.processTicksAndRejections (node:internal/process/task_queues:96:32)
21:18:31 0|start | /home/steam_commentbot/node_modules/output-logger/lib/helpers/printManager.js:80 21:18:31 0|start | process.stdout.moveCursor(0, -1); 21:18:31 0|start | ^ 21:18:31 0|start | TypeError: process.stdout.moveCursor is not a function 21:18:31 0|start | at module.exports.log (/home/steam_commentbot/node_modules/output-logger/lib/helpers/printManager.js:80:24) 21:18:31 0|start | at module.exports.logger (/home/steam_commentbot/node_modules/output-logger/lib/logger.js:92:27) 21:18:31 0|start | at module.exports (/home/steam_commentbot/node_modules/output-logger/index.js:35:39) 21:18:31 0|start | at process.handleUncaughtException (/home/steam_commentbot/src/starter.js:91:13) 21:18:31 0|start | at process.emit (node:events:524:35) 21:18:31 0|start | at process._fatalException (node:internal/process/execution:159:25) 21:18:31 0|start | Node.js v19.8.1 21:18:31 PM2 | App [start:0] exited with code [7] via signal [SIGINT] 21:18:31 PM2 | App [start:0] starting in -fork mode- 21:18:31 PM2 | App [start:0] online `
Oh hey; that's weird!
Which node.js & steam-comment-service-bot version are you using and on which OS is the bot running?
It might be that an older node.js version lacks support for these methods.
oh my bad...
node: v19.8.1 pm2: v5.3.0 os: Ubuntu 20.04.6 LTS commentbot: 2.12.5
Hmm, I'm using the same versions, just not on Ubuntu but on Arch. I might need to check if this is a Ubuntu specific problem, not sure why that should be the case though.
Btw, does the bot crash on every start and also without pm2?
yes the crashes always happen with pm2 and no without pm2 everything works
As soon as I start the bot in the background for example with npm forever or pm2 the bot will instantly crash with the following error:
/"pathtosteambot"/updater.js:23 process.stdout.clearLine() ^
TypeError: process.stdout.clearLine is not a function at logger (/home/steambot/updater.js:23:24) at Object. (/home/steambot/updater.js:287:1)
at Module._compile (internal/modules/cjs/loader.js:1123:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1143:10)
at Module.load (internal/modules/cjs/loader.js:972:32)
at Function.Module._load (internal/modules/cjs/loader.js:872:14)
at Module.require (internal/modules/cjs/loader.js:1012:19)
at require (internal/modules/cjs/helpers.js:72:18)
at Object. (/home/steambot/start.js:55:5)
at Module._compile (internal/modules/cjs/loader.js:1123:30)
error: Forever detected script exited with code: 1
You should be able to reproduce the error, here a quick instruction for npm forever: