I'm trying to make a discord bot with the command prefix "*" but when I try to get the bot online/run it, it gives me this error:
node:internal/modules/cjs/loader:936 node:internal/modules/cjs/loader:936 throw err; ^
Error: Cannot find module 'C:\Users\name\const' at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15) at Function.Module._load (node:internal/modules/cjs/loader:778:27) at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:79:12) at node:internal/main/run_main_module:17:47 { code: 'MODULE_NOT_FOUND', requireStack: [] }
The module I'm using is discord.js and i've installed discord.js on CMD and the VSC terminal but it still comes up with the MODULE NOT FOUND error. I've looked around the internet and I can't find one that fixes the problem. I've tried reinstalling Node.js but it won't stop coming back.
npm install
?? – Accelerationpackage.json
in the directory where you runningnode index.js
. – Acceleration