Androz2091 / discord-music-bot

The perfect music bot for your Discord server! 🤘
238 stars 128 forks source link

Improper handling of token? #67

Closed iijj22gg closed 2 years ago

iijj22gg commented 2 years ago

I'm not really sure what the deal is with this, but I got all the packages installed for it and ended up with

iijj22gg@I-Latitude-E5440:~/Downloads/discord-music-bot-master$ node .
/home/iijj22gg/node_modules/discord.js/src/rest/RESTManager.js:32
    const token = this.client.token ?? this.client.accessToken;
                                     ^

SyntaxError: Unexpected token ?
    at Module._compile (internal/modules/cjs/loader.js:723:23)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
    at Module.load (internal/modules/cjs/loader.js:653:32)
    at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
    at Function.Module._load (internal/modules/cjs/loader.js:585:3)
    at Module.require (internal/modules/cjs/loader.js:692:17)
    at require (internal/modules/cjs/helpers.js:25:18)
    at Object.<anonymous> (/home/iijj22gg/node_modules/discord.js/src/client/BaseClient.js:4:21)
    at Module._compile (internal/modules/cjs/loader.js:778:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)

I did put the token in the .env file. Using Linux btw.

Ch1sKey commented 2 years ago

What node version are you using? Maybe your environment just not supports nullish coalescing(??).

iijj22gg commented 2 years ago

I'm using the latest version; I updated it 2 days ago

Specifically, v10.19.0

SebiAi commented 2 years ago

@IIJJ22GG Is already a duplicate but here is the solution again: Discord.js needs Node.js version 16.6.0 or newer. How you can install that can be easily found out by a quick google search.

iijj22gg commented 2 years ago

@SebiAi Weird. I thought Aptitude had the latest version. I'll get it from the website then.