Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

397
Views
Why do i keep getting error when typing node . or node main.js

I followed a tutorial by Codelyon. I followed it before but now it's not working. I don't know if I just typed something wrong and can't see it, or if I'm missing something completely different. Just to clarify, yes, I saved before typing node . and node main.js

Code

const Discord = require('discord.js');

 const client = new Discord.Client();



client.once('ready', () => {
    console.log('Kilobot is online')
});




client.login('bot token');

Error:

TypeError [CLIENT_MISSING_INTENTS]: Valid intents must be provided for the Client.

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

AFAIK, in the new version you need to specify intents before doing any work. Here's a link on documentation.

// Require the necessary discord.js classes
const { Client, Intents } = require('discord.js');
const { token } = require('./config.json');

// Create a new client instance
const client = new Client({ intents: [Intents.FLAGS.GUILDS] });

// When the client is ready, run this code (only once)
client.once('ready', () => {
    console.log('Ready!');
});

// Login to Discord with your client's token
client.login(token);

And your question is already asked on stackoverflow, in here

about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!