Discord.js v13 sending error. It's alright in discord.js v12. How to fix it?

Viewed 1379

I upgraded my Discord.js v12 to v13 but it send to me this error

/home/discord/project/bloodmoon/node_modules/discord.js/src/rest/APIRequest.js:33
    agent ??= new https.Agent({ ...this.client.options.http.agent, keepAlive: true });
          ^^^

SyntaxError: Unexpected token '??='

My node.js version is 16.7.0

node -v
v16.7.0

I think it's node.js problem it i can't find problem in that. what's the problem?

2 Answers

I had the same issue and fixed it by installing the latest version of NodeJS (16.11.0 at the time I'm writing this), not the LTS version (14.x.x)

To fix this update the latest version of node. Currently v16.9.1

Related