ava-cassiopeia / discord-text-adventure-bot

A bot for Discord to play text adventure games in Discord
ISC License
45 stars 7 forks source link

Running on Raspberry Pi #22

Closed gregunderscorem closed 7 years ago

gregunderscorem commented 7 years ago

I'm trying to run this on a raspberry pi and am running into an issue when I try to launch, I'm assuming that it's because some version of node or something is too old, but I'm unsure.

to be clear: dfrotz is installed and runs. I tried both the npm install and manual install of discord-text-adventure-bot, both went smooth. But then when I launch either install I get the following error:

SyntaxError: Block-scoped declarations (let, const, function, class) not yet supported outside strict mode
    at exports.runInThisContext (vm.js:53:16)
    at Module._compile (module.js:414:25)
    at Object.Module._extensions..js (module.js:442:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:311:12)
    at Module.require (module.js:366:17)
    at require (module.js:385:17)
    at Object.<anonymous> (/home/greg/discord-text-adventure-bot/client-spawner.js:1:86)
    at Module._compile (module.js:435:26)
    at Object.Module._extensions..js (module.js:442:10)

running 'node --use_strict app.js' returns:

discord-text-adventure-bot/MessageHandler.js:157
    setTargetChannel(channelID, notify = false, doWrite = true){
                                                                     ^

SyntaxError: Unexpected token =
    at exports.runInThisContext (vm.js:53:16)
    at Module._compile (module.js:414:25)
    at Object.Module._extensions..js (module.js:442:10)
    at Module.load (module.js:356:32)
    at Function.Module._load (module.js:311:12)
    at Module.require (module.js:366:17)
    at require (module.js:385:17)
    at Object.<anonymous> (/home/greg/discord-text-adventure-bot/client-spawner.js:1:86)
    at Module._compile (module.js:435:26)
    at Object.Module._extensions..js (module.js:442:10)

I've run into errors before while running programs on the raspberry pi where the packages I was using were a bit out of date. I'm assuming something similar is here, but don't know enough to figure out the specifics. Any ideas?

And thanks. This is a cool project.

ava-cassiopeia commented 7 years ago

What version of Node are you running?

If you don't know, type:

node -v
gregunderscorem commented 7 years ago

v4.2.1

ava-cassiopeia commented 7 years ago

Is there any particular reason you're running that version?

Specifically, the error you're seeing is because the Node code for the bot uses some ES2015 things, such as optional parameters. I'd recommend upgrading to the newest version possible to solve this.

gregunderscorem commented 7 years ago

Ah good, my suspicion was right! I'm running it because it's the version that's "up to date" in my package manager apparently, I'll manually update it. Sometimes 'apt-get update' just isn't enough.

Thanks for the quick reply.

ava-cassiopeia commented 7 years ago

No problem, let me know if you have any other issues!