1

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
dee
  • 2,244
  • 3
  • 13
  • 33
Zhenk
  • 41
  • 1
  • 5
  • 1
    Does this answer your question? [error when requiring discordjs - cannot find module 'node:events'](https://stackoverflow.com/questions/69489101/error-when-requiring-discordjs-cannot-find-module-nodeevents) – MrMythical Dec 01 '21 at 05:08

2 Answers2

0

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.

Smit Gajera
  • 1,001
  • 1
  • 8
  • 26
0

You use too old version of node.js. According to this doc node 16.6.0 required. Just update your node.js version by install new or by nvm(for manage different node.js version on your PC). enter image description here

Alex Gor
  • 533
  • 4
  • 18