Answer the question
In order to leave comments, you need to log in
Shows error MODULE_NOT_FOUND, what's the problem?
Good afternoon. There are developments for the bot: https://github.com/Gospodin116/discordjs-bot-ts .
When compiling npm run dev
everything is fine. But when I run npm run start
it, it throws an error [MODULE_NOT_FOUND]
.
The error itself :
webpack://ac_community/./node_modules/discord.js/src/client/actions/_sync_^\.\/.*$?:111
throw e;
^
Error: Cannot find module './index.js'
at webpackContextResolve (webpack://ac_community/./node_modules/discord.js/src/client/actions/_sync_^\.\/.*$?:109:11)
at webpackContext (webpack://ac_community/./node_modules/discord.js/src/client/actions/_sync_^\.\/.*$?:104:11)
at new ActionsManager (webpack://ac_community/./node_modules/discord.js/src/client/actions/ActionsManager.js?:13:114)
at new Client (webpack://ac_community/./node_modules/discord.js/src/client/Client.js?:100:20)
at eval (webpack://ac_community/./src/index.ts?:2:14)
at Object../src/index.ts (C:\Dev\Bots\discord\ac_community\dist\index.js:4087:1)
at __webpack_require__ (C:\Dev\Bots\discord\ac_community\dist\index.js:4518:42)
at C:\Dev\Bots\discord\ac_community\dist\index.js:4575:37
at Object.<anonymous> (C:\Dev\Bots\discord\ac_community\dist\index.js:4577:12)
at Module._compile (node:internal/modules/cjs/loader:1109:14) {
code: 'MODULE_NOT_FOUND'
client.once('ready', () => {
console.log('Ready!');
});
Answer the question
In order to leave comments, you need to log in
Most likely, the error does not come from client once ready, because it is a normal listener. The error says that the index.js file was not found. I advise you to run the bot not with npm run start but with node.js.
Also, could you post the full code?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question