Ask coding questions

← Back to all posts
raremyc
h
0605VedantVedan

/home/runner/raremyc/node_modules/discord.js/src/rest/RESTManager.js:32
const token = this.client.token ?? this.client.accessToken;
^

SyntaxError: Unexpected token '?'

why this error and how to solve it

Voters
Debarchito
0605VedantVedan
Comments
hotnewtop
Debarchito

I guess you are trying to use Discord.js v13? You need to update Node to v16.6+ and NPM to v7+. Take a look on how you can do it: https://replit.com/talk/learn/Easiest-way-to-get-Node-v166-for-your-Discordjs-v13-projects/143841