#MODULE_NOT_FOUND

10 messages · Page 1 of 1 (latest)

icy kettle
#

Hello!

I encountered a problem when trying to run my Discord.js bot. I don't know why I keep getting this error even though I upgraded the version of Discord.js (14.11.0 -> latest version). I also tried "clean install" by removing the node_modules dir and reinstalling all the dependencies. What should I do to fix this error?

Here's the error message:

node index.js
node:internal/modules/cjs/loader:598
      throw e;
      ^

Error: Cannot find module '\node_modules\@vladfrangu\async_event_emitter\dist\index.js'
    at createEsmNotFoundErr (node:internal/modules/cjs/loader:1181:15)
    at finalizeEsmResolution (node:internal/modules/cjs/loader:1169:15)
    at resolveExports (node:internal/modules/cjs/loader:591:14)
    at Module._findPath (node:internal/modules/cjs/loader:668:31)
    at Module._resolveFilename (node:internal/modules/cjs/loader:1130:27)
    at Module._load (node:internal/modules/cjs/loader:985:27)
    at Module.require (node:internal/modules/cjs/loader:1235:19)
    at require (node:internal/modules/helpers:176:18)
    at Object.<anonymous> (\node_modules\@discordjs\rest\dist\index.js:649:34)
    at Module._compile (node:internal/modules/cjs/loader:1376:14) {
  code: 'MODULE_NOT_FOUND',
  path: '\\node_modules\\@vladfrangu\\async_event_emitter\\package.json'
}

Node.js v20.11.0

PS I removed the actual path of my workspace for security purposes

nimble kettleBOT
#
  • What's your exact discord.js npm list discord.js and node node -v version?
  • Not a discord.js issue? Check out #1081585952654360687.
  • Consider reading #how-to-get-help to improve your question!
  • Explain what exactly your issue is.
  • Post the full error stack trace, not just the top part!
  • Show your code!
  • Issue solved? Press the button!
feral jewel
#

Can you run npm ls @vladfrangu/async_event_emitter please?

icy kettle
feral jewel
#

That looks fine. Try reinstalling. How exactly did you reinstall after the removal of node_modules?

icy kettle
#

So, after I remove the node_modules dir, I just simply run npm i.

feral jewel
#

That should be correct. As Long as you have the package.json setup correctly and run it in the correct folder