#I met some problem with discord.js, can anyone help me please

1 messages · Page 1 of 1 (latest)

silent elk
#

I am a new developer here, and I met some problem with discord.js, please help me

There's my code

#!/usr/local/bin/node
require("dotenv").config();
const { Client, GatewayIntentBits } = require('discord.js');
const client = new Client({ intents: [GatewayIntentBits.Guilds] });
client.on("ready", () => {
    console.log(`logged in as ${client.user.tag}`);
});
client.login(process.env.TOKEN);

and this is the errors

node:internal/process/promises:279
            triggerUncaughtException(err, true /* fromPromise */);
            ^

Error: unable to verify the first certificate
    at TLSSocket.onConnectSecure (node:_tls_wrap:1539:34)
    at TLSSocket.emit (node:events:513:28)
    at TLSSocket._finishInit (node:_tls_wrap:953:8)
    at TLSWrap.ssl.onhandshakedone (node:_tls_wrap:734:12) {
  code: 'UNABLE_TO_VERIFY_LEAF_SIGNATURE'
}
slim locust
#

What is your NodeJS version?

silent elk
#

it's v16.18.1

slim locust
#

You should update it to v16.9.0 or higher

gleaming pawn
#

?

silent elk
#

ok, thank you

gleaming pawn
#

he's higher than 16.9

slim locust
#

💀

silent elk
#

wait, it's already higher than v16.9.0, i blind too

slim locust
#

I don't know honestly.. Mine is v18.6, so you can try updating it shrug

silent elk
#

ok, thank you so much..

slim locust
#

anytime!

silent elk
#

It still have some problem, and the same error output