Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

229
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda