Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when trying to use discord.js #9757

Closed
Scrapmine opened this issue Aug 8, 2023 · 1 comment
Closed

Error when trying to use discord.js #9757

Scrapmine opened this issue Aug 8, 2023 · 1 comment

Comments

@Scrapmine
Copy link

Scrapmine commented Aug 8, 2023

Which package is this bug report for?

discord.js

Issue description

  1. Run the code sample
  2. Get this error
        userAgentAppendix: options.rest?.userAgentAppendix
                                        ^
SyntaxError: Unexpected token '.'
    at wrapSafe (internal/modules/cjs/loader.js:915:16)
    at Module._compile (internal/modules/cjs/loader.js:963:27)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
    at Module.load (internal/modules/cjs/loader.js:863:32)
    at Function.Module._load (internal/modules/cjs/loader.js:708:14)
    at Module.require (internal/modules/cjs/loader.js:887:19)
    at require (internal/modules/cjs/helpers.js:74:18)
    at Object.<anonymous> (/home/arild/Minecraft/discord-bot/node_modules/discord.js/src/index.js:6:22)
    at Module._compile (internal/modules/cjs/loader.js:999:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)

Code sample

const { Client, Intents } = require('discord.js');
const client = new Client({ intents: [Intents.FLAGS.GUILDS, Intents.FLAGS.GUILD_MESSAGES] });

Versions

[email protected]
v12.22.9
Linux Mint 21.1 Cinnamon

Issue priority

Medium (should be fixed soon)

Which partials do you have configured?

No Partials

Which gateway intents are you subscribing to?

Guilds, GuildMessages

I have tested this issue on a development release

not tested in dev release

@Jiralite
Copy link
Member

Jiralite commented Aug 8, 2023

discord.js requires Node.js version 16.11.0. You can read the guide here. In addition, it seems you are using version 13 code with version 14 code. Again, I'd recommend the guide.

@Jiralite Jiralite closed this as not planned Won't fix, can't repro, duplicate, stale Aug 8, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 7, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants