#missing module error (npm)

36 messages · Page 1 of 1 (latest)

twin finch
#

i keep getting the missing module node:events error, i've updated npm, reinstalled djs

noble citrus
#

• What's your exact discord.js npm list discord.js and node node -v version?
• Post the full error stack trace, not just the top part!
• Show your code!
• Explain what exactly your issue is.
• Not a discord.js issue? Check out #useful-servers.

twin finch
#

how do i if i'm using replit

#

npm update node?

twin finch
final flower
#

Google it or ask Replit Community

twin finch
#

ok

#

i updated node and it still keeps throwing errors

#

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

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

  • /home/runner/Saturn-Bot-2/node_modules/discord.js/src/client/BaseClient.js
  • /home/runner/Saturn-Bot-2/node_modules/discord.js/src/index.js
  • /home/runner/Saturn-Bot-2/node_modules/discord-buttons/src/index.js
  • /home/runner/Saturn-Bot-2/index.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/Saturn-Bot-2/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)
    at require (internal/modules/cjs/helpers.js:92:18)
    at Object.<anonymous> (/home/runner/Saturn-Bot-2/node_modules/discord.js/src/index.js:6: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) {
    code: 'MODULE_NOT_FOUND',
    requireStack: [
    '/home/runner/Saturn-Bot-2/node_modules/discord.js/src/client/BaseClient.js',
    '/home/runner/Saturn-Bot-2/node_modules/discord.js/src/index.js',
    '/home/runner/Saturn-Bot-2/node_modules/discord-buttons/src/index.js',
    '/home/runner/Saturn-Bot-2/index.js'
    ]
    }
    exit status 1
#

do u know why that error is happening

#

?

viral relic
#

djs requires node v16.9 or higher

twin finch
#

and do u know what mine is?

#

judging by that error

viral relic
#

lower than 16.9

#

• What's your exact discord.js npm list discord.js and node node -v version?

twin finch
#

ok

#

lemme look

#

it worked perfectly fine yesterday

#

im on v14

#

so lemme update

#

16.18.0 good?

viral relic
#

18 is greater than 9

twin finch
#

yes then

#

but i just ran it and i still get the error

#

lemme just check version

viral relic
#

then you are still using an old version of node. you can log process.version at the top of your main entry file

twin finch
#

ok

#

it says im on v6.18 now

#

whats the latest version of node

final flower
#

Visit their website

#

All your questions are not related to discord.js
#useful-servers or #869652447881207858

twin finch
#

now ive finally updated to v16.18.0

#

and it still throws errors

#

should i uninstall djs then reinstall it