Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

182
Vistas
Why isn't DiscordJS Function properly and sending a can not find module error?

I updated the node and discord.js version of my bot(Hosted on Repl.it), and since then I can not seem to use the DiscordJS Library. I have two bots I am using, one is working properly even though it is like the latest version while the other one, which I updated, is not working properly. So I thought there must be something wrong with my Repl(Project), so I created a new one. However, that still does not work. It throws the error:

Require stack:
- /home/runner/Bot/node_modules/discord.js/src/client/BaseClient.js
- /home/runner/Bot/node_modules/discord.js/src/index.js
- /home/runner/Bot/index.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:815:15)
    at Function.Module._load (internal/modules/cjs/loader.js:667:27)
    at Module.require (internal/modules/cjs/loader.js:887:19)
    at require (internal/modules/cjs/helpers.js:74:18)
    at Object.<anonymous> (/home/runner/Bot/node_modules/discord.js/src/client/BaseClient.js:3:22)
    at Module._compile (internal/modules/cjs/loader.js:999:30)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
    at Module.load (internal/modules/cjs/loader.js:863:32)
    at Function.Module._load (internal/modules/cjs/loader.js:708:14)
    at Module.require (internal/modules/cjs/loader.js:887:19)

I tried to debug it myself and first omit the DiscorJS Library and run the program with a console.log() statement, and it works without an error. So there is something wrong with either NodeJS or DiscordJS. Why is this happening?

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

I found the solution after some more debugging.

  1. Type npm install node@16 in the shell.
  2. Create a new file on the main directory of the Repl with the name .replit and type run = "npx node index.js" in it. Now try to run the file. It should work with the DiscordJS Library
about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda