Home > Net >  error starting node discordjs, how i can start?
error starting node discordjs, how i can start?

Time:12-03

Good, I apologize for the inconvenience, I would like to know if this has happened to someone, I am trying to run a bot in Ubuntu 18, but it does not start, I already installed everything as in Windows but for Ubuntu clearly.

In windows, the same bot works, but when I try to start it in Ubuntu, it throws me this error, I have already installed a thousand things on the machine that literally nothing to do with it. If someone could help me or allow me where to read, I would be infinitely grateful.

root@ns533280:/home/Discord/Test# node index.js
module.js:487
throw err;
^

Error: Cannot find module 'node:events'
at Function.Module._resolveFilename (module.js:485:15)
at Function.Module._load (module.js:437:25)
at Module.require (module.js:513:17)
at require (internal/module.js:11:18)
at Object.<anonymous> 
(/home/Discord/Test/node_modules/discord.js/src/client/BaseClient.js:3:22)
at Module._compile (module.js:569:30)
at Object.Module._extensions..js (module.js:580:10)
at Module.load (module.js:503:32)
at tryModuleLoad (module.js:466:12)
at Function.Module._load (module.js:458:3)
root@ns533280:/home/Discord/Test# node -v
v8.0.0
root@ns533280:/home/Discord/Test# npm -v
5.0.0

CodePudding user response:

How To Solve Error: Cannot find module 'node:events' Error?

To Solve Error:- Cannot find module 'node:events' Error Minimum required nodejs version is v16.6 in order to use discord.js. So You just need to update nodejs to v16.6. And Your error will be solved.

CodePudding user response:

You use too old version of node.js. According to this enter image description here

  • Related