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 toolkit•10mo 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 🌈
chewie 🌈•10mo ago
update nodejs to at least 16.12
An00xy
An00xy•10mo ago
I've it 16.11.0 on discord.js there's doc that should be 16.11.0 or higher
An00xy
An00xy•10mo ago
Mark
Mark•10mo 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 🌈
chewie 🌈•10mo ago
@An00xy Is this issue still present or can I close this
An00xy
An00xy•10mo ago
My bad, u can close, Ty