Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

180
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda