why am I getting those errors?

all I have in code is this:
const { Client, GatewayIntentBits } = require('discord.js');

const intents = new GatewayIntentBits([
'GUILDS',
'GUILD_MESSAGES',
]);

const client = new Client({ intents });

client.once('ready', () => {
console.log(`Logged in as ${client.user.tag}`);
});

client.login('token');
const { Client, GatewayIntentBits } = require('discord.js');

const intents = new GatewayIntentBits([
'GUILDS',
'GUILD_MESSAGES',
]);

const client = new Client({ intents });

client.once('ready', () => {
console.log(`Logged in as ${client.user.tag}`);
});

client.login('token');
8 Replies
d.js toolkit
d.js toolkit17mo ago
- What's your exact discord.js npm list discord.js and node node -v version? - Not a discord.js issue? Check out #other-js-ts. - Consider reading #how-to-get-help to improve your question! - Explain what exactly your issue is. - Post the full error stack trace, not just the top part! - Show your code! - Issue solved? Press the button!
chewie
chewie17mo ago
update nodejs to at least 16.12
An00xy
An00xyOP17mo ago
I've it 16.11.0 on discord.js there's doc that should be 16.11.0 or higher
An00xy
An00xyOP17mo ago
Mark
Mark17mo ago
at the top of your index.js (before you require d.js or anything else) please add console.log(process.version) and show the output
chewie
chewie17mo ago
@An00xy Is this issue still present or can I close this
An00xy
An00xyOP17mo ago
My bad, u can close, Ty
Want results from more Discord servers?
Add your server