Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

181
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!