That error

Cannot find module ‘node:events’ is actually a Node.js version compatibility issue, not a problem with your discord.js install.

Here’s why:

  • discord.js v13 (and above) uses the modern node: protocol imports like node:events.
  • This syntax is only supported starting from Node.js v16.9.0 or later.
  • If you run it with Node.js 14 or older, you’ll get exactly this error

How to fix it

Upgrade Node.js

Check your Node.js version:
node -v

  1.  If it’s less than 16.9.0, you need to upgrade.
  2. Download and install the latest LTS version from:🔗https://nodejs.org/en/download

    After upgrading, verify:
    node -v

  3. Should show 16.9.0 or newer (preferably 20.x or 22.x).
    Reinstall dependencies:
    rm -rf node_modules package-lock.json
    npm install

Need Help With Node Development?

Work with our skilled Node developers to accelerate your project and boost its performance.

Hire Node.js Developers

Support On Demand!

Related Q&A