botgram / shell-bot

:robot: Telegram bot that executes commands and sends the live output
GNU General Public License v3.0
787 stars 493 forks source link

Cannot read property 'SOCKET' of undefined #27

Open ghost opened 4 years ago

ghost commented 4 years ago

Hello, when I execute /run < command >, the bot will report an error. To execute another command, such as /cd, the bot works normally.

/root/shell-bot/node_modules/node-pty/lib/unixTerminal.js:269
        var handle = new Pipe(constants.SOCKET);
                                       ^

TypeError: Cannot read property 'SOCKET' of undefined
    at new PipeSocket (/root/shell-bot/node_modules/node-pty/lib/unixTerminal.js:269:40)
    at new UnixTerminal (/root/shell-bot/node_modules/node-pty/lib/unixTerminal.js:94:25)
    at Object.spawn (/root/shell-bot/node_modules/node-pty/lib/index.js:28:12)
    at new Command (/root/shell-bot/lib/command.js:22:18)
    at Bot.<anonymous> (/root/shell-bot/server.js:192:25)
    at Bot.<anonymous> (/root/shell-bot/node_modules/botgram/lib/message.js:87:22)
    at HandlerQueue.callHandler (/root/shell-bot/node_modules/botgram/lib/message.js:63:29)
    at Bot.<anonymous> (/root/shell-bot/node_modules/botgram/lib/message.js:86:43)
    at HandlerQueue.callHandler (/root/shell-bot/node_modules/botgram/lib/message.js:63:29)
    at Bot.<anonymous> (/root/shell-bot/node_modules/botgram/lib/message.js:86:43)
mildsunrise commented 4 years ago

are you sure that npm install finished correctly?

ghost commented 4 years ago

are you sure that npm install finished correctly?

It may be because the nodejs version(V6) is too low. After upgrading the nodejs version, the bot can run normally