2

I'm getting this error when running my discord bot code online. This doesn't happen when I'm running it on VSCode and I'm not able to figure out why. How can I stop this error from happening?

RuntimeError: Cannot find module 'node:events'
Require stack:
- /opt/node_modules/discord.js/src/client/BaseClient.js

Error: Cannot find module 'node:events'
Require stack:
- /opt/node_modules/discord.js/src/client/BaseClient.js

The JSON output of the error is below.
{
  "error": {
    "type": "RuntimeError",
    "message": "Cannot find module 'node:events'\nRequire stack:\n- /opt/node_modules/discord.js/src/client/BaseClient.js",
    "stack": "Error: Cannot find module 'node:events'\nRequire stack:\n- /opt/node_modules/discord.js/src/client/BaseClient.js"
  }
}

0 Answers0