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

403
Views
Discord JS - Error: Cannot find module 'node:events' on node v16.14.0

I am currently using node v16.14.0 as per the title and getting this error:

Error: Cannot find module 'node:events'
Require stack:
- /Users/username/bp/bp-website/backend/node_modules/discord.js/src/client/BaseClient.js
- /Users/username/bp/bp-website/backend/node_modules/discord.js/src/index.js
- /Users/username/bp/bp-website/backend/discord/bot.js
- /Users/username/bp/bp-website/backend/discord/purchase.js
- /Users/username/bp/bp-website/backend/webserver.js
- /Users/username/bp/bp-website/backend/index.js
    at Function.Module._resolveFilename (node:internal/modules/cjs/loader:924:15)
    at Function.Module._load (node:internal/modules/cjs/loader:769:27)
    at Module.require (node:internal/modules/cjs/loader:996:19)
    at require (node:internal/modules/cjs/helpers:92:18)
    at Object.<anonymous> (/Users/username/bp/bp-website/backend/node_modules/discord.js/src/client/BaseClient.js:3:22)
    at Module._compile (node:internal/modules/cjs/loader:1092:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1121:10)
    at Module.load (node:internal/modules/cjs/loader:972:32)
    at Function.Module._load (node:internal/modules/cjs/loader:813:14)
    at Module.require (node:internal/modules/cjs/loader:996:19) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    '/Users/username/bp/bp-website/backend/node_modules/discord.js/src/client/BaseClient.js',
    '/Users/username/bp/bp-website/backend/node_modules/discord.js/src/index.js',
    '/Users/username/bp/bp-website/backend/discord/bot.js',
    '/Users/username/bp/bp-website/backend/discord/purchase.js',
    '/Users/username/bp/bp-website/backend/webserver.js',
    '/Users/username/bp/bp-website/backend/index.js'
  ]
}

I have looked at other questions, however, they all say upgrade to Node v16.6 which I downgraded to to test but also still didn't work. Any help would be greatly appreciated!

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

0

Run node -v in the terminal. If the output is v16.6.0 or higher, you're good to go, because the required version of discord.js is v16.6.0 or higher. Click here to read full documentation from discord.js . Without the latest version of node.js you might get errors like:

1.Unexpected token '?'

2.Cannot find module: 'node:events'

about 4 years ago · Juan Pablo Isaza Report

0

const client = new Discord.Client({ intents: ["DIRECT_MESSAGES", "GUILD_MESSAGES"] });

instead of:

const client = new Discord.Client();
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!