[英]How can I fix this "missing module" error (node.js/discord.js)?
Here's the code, I was trying to run a discord bot file.这是代码,我试图运行 discord 机器人文件。
$ node index.js
internal/modules/cjs/loader.js:883
throw err;
^
Error: Cannot find module 'node:events'
Require stack:
- /path/bot/node_modules/discord.js/src/client/BaseClient.js
- /path/bot/node_modules/discord.js/src/index.js
- /path/bot/index.js
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:880:15)
at Function.Module._load (internal/modules/cjs/loader.js:725:27)
at Module.require (internal/modules/cjs/loader.js:952:19)
at require (internal/modules/cjs/helpers.js:88:18)
at Object.<anonymous> (/path/bot/node_modules/discord.js/src/client/BaseClient.js:3:22)
at Module._compile (internal/modules/cjs/loader.js:1063:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
at Module.load (internal/modules/cjs/loader.js:928:32)
at Function.Module._load (internal/modules/cjs/loader.js:769:14)
at Module.require (internal/modules/cjs/loader.js:952:19) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'/path/bot/node_modules/discord.js/src/client/BaseClient.js',
'/path/bot/node_modules/discord.js/src/index.js',
'/path/bot/index.js'
]
}
What module would be missing?会缺少什么模块? I haven't really fiddled around with node.js much, or discord.js, so I have no idea what could be going wrong.
我并没有真正摆弄 node.js 或 discord.js,所以我不知道可能出了什么问题。 Plz help:)
请帮助:)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.