Im trying to make a Discord Bot as a Plugin on BDSX which is a Minecraft Bedrock Edition Server Software that supports node.js but when i try to run it the Plugin fails to load
This is my Code im using node.js v16.16.0 and discord.js v14.6.0
const { Client, GatewayIntentBits, ActivityType } = require('discord.js');
const client = new Client({ intents: [GatewayIntentBits.Guilds, GatewayIntentBits.GuildMessages, GatewayIntentBits.MessageContent, GatewayIntentBits.GuildBans, GatewayIntentBits.GuildMembers] });
const config = require("./config.json");
client.on('ready', () => {
console.log(`Logged in as ${client.user.tag}!`);
});
client.login(config.token);
It worked when i tried running this code alone and it worked but on the server it gave this error message
[BDSX-Plugins] Loading @bdsx/discord-bot (1/1)
[BDSX-Plugins] Failed to load @bdsx/discord-bot
Error: Cannot find module 'node:events'
at require (internal/modules/cjs/helpers.js:22:7)
at Anonymous function (G:\Desktop\Minecraft Modding\Bedrock\_____\Server\bdsx-master\node_modules\discord.js\src\client\BaseClient.js:3:1)
at require (internal/modules/cjs/helpers.js:22:7)
at Anonymous function (G:\Desktop\Minecraft Modding\Bedrock\_____\Server\bdsx-master\node_modules\discord.js\src\index.js:6:1)
Edit 1:I allready tried to update discord.js and node.js
Edit 2: when i start the server it says this
[test] node version: 12.0.0-pre
[test] engine version: chakracore@1.11.24.0
how to i update the node version on the server