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

219
Views
trying to run npm start on a discord bot but i keep getting a 'node:events' error. While using node v16.13.1

package.json

 {
  "name": "5ambot",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1",
    "start": "node index.js",
    "dev": "nodemon index.js"
  },
  "keywords": [],
  "author": "",
  "license": "ISC",
  "dependencies": {
    "discord.js": "^13.5.0",
    "dotenv": "^10.0.0"
  },
  "devDependencies": {
    "nodemon": "^2.0.15"
  }
}

when i run npm start i gett an error in internal/modules/cjs/loader.js:892

error

Error: Cannot find module 'node:events'
Require stack:
- DIR\node_modules\discord.js\src\client\BaseClient.js
- DIR\node_modules\discord.js\src\index.js
- DIR\index.js
    at Function.Module._resolveFilename (internal/modules/cjs/loader.js:889:15)
    at Function.Module._load (internal/modules/cjs/loader.js:745:27)
    at Module.require (internal/modules/cjs/loader.js:961:19)
    at require (internal/modules/cjs/helpers.js:92:18)
    at Object.<anonymous> (DIR\node_modules\discord.js\src\client\BaseClient.js:3:22)
    at Module._compile (internal/modules/cjs/loader.js:1072:14)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:1101:10)
    at Module.load (internal/modules/cjs/loader.js:937:32)
    at Function.Module._load (internal/modules/cjs/loader.js:778:12)
    at Module.require (internal/modules/cjs/loader.js:961:19) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    'DIR\\node_modules\\discord.js\\src\\client\\BaseClient.js',
    'DIR\\node_modules\\discord.js\\src\\index.js',
    'DIR\\index.js'
  ]
}

i tried reinstalling package-lock: -rm -rf node_modules package-lock.json && npm install && npm start

didn't work. I am out of ideas and everyone says its cuz the node version is too low and i saw no other solution. Please help

edit: i came to a conclusion that its the discord.js that isn't loading correctly with npm install discord.js

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

0

try

Delete node_modules run

npm cache clean --force
npm install
npm run start

or try yarn

yarn
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!