Ask coding questions

← Back to all posts
exit stats 1
OllieThePoliteCat

I am making a discord bot and the error says this

[email protected] start /home/runner/class-Main
node main.js

internal/modules/cjs/loader.js:905
throw err;
^

Error: Cannot find module 'node:events'
Require stack:

  • /home/runner/class-Main/node_modules/discord.js/src/client/BaseClient.js
  • /home/runner/class-Main/node_modules/discord.js/src/index.js
  • /home/runner/class-Main/node_modules/discord-player/dist/Player.js
  • /home/runner/class-Main/node_modules/discord-player/dist/index.js
  • /home/runner/class-Main/main.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:902:15)
    at Function.Module._load (internal/modules/cjs/loader.js:746:27)
    at Module.require (internal/modules/cjs/loader.js:974:19)
    at require (internal/modules/cjs/helpers.js:92:18)
    at Object.<anonymous> (/home/runner/class-Main/node_modules/discord.js/src/client/BaseClient.js:3:22)
    at Module._compile (internal/modules/cjs/loader.js:1085:14)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1114:10)
    at Module.load (internal/modules/cjs/loader.js:950:32)
    at Function.Module._load (internal/modules/cjs/loader.js:790:14)
    at Module.require (internal/modules/cjs/loader.js:974:19) {
    code: 'MODULE_NOT_FOUND',
    requireStack: [
    '/home/runner/class-Main/node_modules/discord.js/src/client/BaseClient.js',
    '/home/runner/class-Main/node_modules/discord.js/src/index.js',
    '/home/runner/class-Main/node_modules/discord-player/dist/Player.js',
    '/home/runner/class-Main/node_modules/discord-player/dist/index.js',
    '/home/runner/class-Main/main.js'
    ]
    }
    npm ERR! code ELIFECYCLE
    npm ERR! errno 1
    npm ERR! [email protected] start: node main.js
    npm ERR! Exit status 1
    npm ERR!
    npm ERR! Failed at the [email protected] start script.
    npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! /home/runner/.npm/_logs/2021-10-06T06_29_19_207Z-debug.log

Voters
OllieThePoliteCat