question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

cannot find node:event module

See original GitHub issue

Which package is this bug report for?

discord.js

Issue description

  1. just “const { EmbedBuilder, WebhookClient } = require( “discord.js” );” this code

Error: Cannot find module ‘node:events’ at require (internal/modules/cjs/helpers.js:22:7) at Anonymous function (D:\project\node_modules\discord.js\src\client\BaseClient.js:3:1) at require (internal/modules/cjs/helpers.js:22:7) at Anonymous function (D:\project\node_modules\discord.js\src\index.js:6:1)

Code sample

const { EmbedBuilder, WebhookClient } = require( "discord.js" );

Package version

14.6.0

Node.js version

18.12.1

Operating system

windows 10

Priority this issue should have

High (immediate attention needed)

Which partials do you have configured?

No Partials

Which gateway intents are you subscribing to?

No Intents

I have tested this issue on a development release

No response

Issue Analytics

  • State:closed
  • Created 9 months ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
job-gutcommented, Dec 18, 2022

No It’s a bug. Did u see my node version?

0reactions
almeidxcommented, Dec 18, 2022

High chance that is not the node version used in your bots process. Try console.log(process.version) before importing discord.js

Read more comments on GitHub >

github_iconTop Results From Across the Web

Error when requiring discordjs: "cannot find module 'node ...
The required Node.js version for discord.js is v16.6. Without it you could get ... Unexpected token '?'; Cannot find module 'node:events'.
Read more >
Error: Cannot find module 'node:events' - Code Help - Discord
I am getting an error pretty annoying after with pnpm enabled. _ internal/modules/cjs/loader.js:613 throw err; ^ Error: Cannot find module 'node:events'
Read more >
cannot find module [Node npm Error Solved] - freeCodeCamp
To fix the error, you need to install the package that is absent in your project directory – npm install package-name or yarn...
Read more >
Error: Cannot find module 'node:events' - Reddit
I'm new to node and when I tried searching this error, it appeared in stackoverflow only 5 days ... Error: Cannot find module...
Read more >
Error TS2307: Cannot find module events - TypeScript TV
Extending the EventEmitter class from Node.js might cause error TS2307. Here is how to fix it.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found