I can't run my Discord bot

I am getting an error like this. Can you help me?

} catch {
SyntaxError: Unexpected token {
at createScript (vm.js:80:10)
at Object.runInThisContext (vm.js:139:10)
at Module._compile (module.js:617:28)
at Object.Module._extensions..js (module.js:664:10)
at Module.load (module.js:566:32)
at tryModuleLoad (module.js:506:12)
at Function.Module._load (module.js:498:3)
at Module.require (module.js:597:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (/rbd/pnpm-volume/5ec88bee-efd0-4dac-8ba2-efc891308f0a/node_modules/discord.js/src/index.js:8:11)

What version of Discord.js are you using? Also, can you send a link to the project? It looks like you have an issue with an async try…catch block.

discord.js version v12, I’ll leave the link from private. Thanks in advance

This seems to be a project error. When you define client, is your typing right?

I have moved this to #discord-help.

Hi, this is a problem with the version of Node.js installed in your Glitch project, see thread here: That { lost in thin air

You can remix a fresh instance of hello-express and migrate your code into it, or find a way to upgrade your node version in the current project (which is harder in my opinion)

Hope it helps!

This is a package issue.

I think something that could help is try using master. IF you are sharding (which I recommend you not to do), brodcastEval will not work.

solved the problem friends, thank you all :slightly_smiling_face:

1 Like