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

401
Views
Discord.js: Error: "Cannot find module 'node:events'" after updating to v13

Today I updated my node version from 12.x to 17.1.0 and my discord.js to 13.3.1. The process of updating was successful but after I run my bot, it outputs the error:

Error: Cannot find module 'node:events'
Require stack:
- /home/runner/rice-v13/node_modules/discord.js/src/client/BaseClient.js
- /home/runner/rice-v13/node_modules/discord.js/src/index.js
- /home/runner/rice-v13/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/rice-v13/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

Also, I noticed that when I installed a new node version via shell it outputs a warning:

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.13 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.13: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

I surfed this question on the Internet and only found answers like "You gotta have node version 16 or higher" but I actually have 17.1.0.

about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

I see that you're using replit for your bot. This error happens when your repl node version is not high enough. You can fix that by using the NodeJS v16 Template (https://replit.com/@RoBlockHead/NodeJS-16). Just fork that repl template and move all your code there.

about 4 years ago · Juan Pablo Isaza Report

0

Instead of:

const client = new Discord.Client();

Type:

const client = new Discord.Client({ intents: ["DIRECT_MESSAGES", "GUILD_MESSAGES"] });
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!