why do i get module not found if the directory i put for "main" in package.json is correct (i think)

honored.js (a.k.a index.js or bot.js): https://srcb.in/FQImchjC6m package.json (I am aware some dependencies are missing from this): https://srcb.in/LMd5nXq0OS package-lock.json: https://srcb.in/GghBvBr9ni node js version: v20.12.1 discord.js version: v14.14.1 (ran npm list discord.js) this bot did not originally support slash cmds, and im not planning to add support for it you can find the bots source code here but i updated it so its a bit different (warning, step 2 is vague so you have to go to individual commands and view the directory thats mentioned so you can move the correct folders to rewrite folder): https://github.com/enlarged/honored-bot tl;dr: halp šŸ„ŗ quick/simplified folder & file visual in visual studio (after following README): HONORED BOT/ ā”‚ ā”œā”€ā”€ honored1/ ā”‚ ā”œā”€ā”€ Commands/ ā”‚ ā”‚ ā”œā”€ā”€ (command folders with respecitve files in em) ā”‚ ā”‚ ā”œā”€ā”€ ... ā”‚ ā”‚ ā””ā”€ā”€ ... ā”‚ ā”‚ ā”‚ ā””ā”€ā”€ honored.js ā”‚ ā”œā”€ā”€ rewrite/ ā”‚ ā”œā”€ā”€ (Util and Database folder with respective files (dont ask me why the original owner didnt just use a db like mongodb, idk either) ā”‚ ā”‚ ā”œā”€ā”€ ... ā”‚ ā”‚ ā””ā”€ā”€ ... ā”‚ ā”‚ ā”‚ ā””ā”€ā”€ (Other bot files) ā”‚ ā”œā”€ā”€ package-lock.json ā””ā”€ā”€ package.json terminal err msg (dw i didnt use real name lol): node:internal/modules/cjs/loader:451 throw err; ^ Error: Cannot find module 'C:\Users\Hikari\Searches\Favorites\honored-bot\honored.js'. Please verify that the package.json has a valid "main" entry at tryPackage (node:internal/modules/cjs/loader:443:19) at Module._findPath (node:internal/modules/cjs/loader:714:18) at resolveMainPath (node:internal/modules/run_main:26:23) at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:128:24) at node:internal/main/run_main_module:28:49 { code: 'MODULE_NOT_FOUND', path: 'C:\Users\Hikari\Searches\Favorites\honored-bot\package.json', requestPath: 'C:\Users\Hikari\Searches\Favorites\honored-bot' } Node.js v20.12.1
SourceBin
package.json
borrowed from a stable bot
SourceBin
package-lock.json
Instantly share your code with the world.
GitHub
GitHub - enlarged/honored-bot: source codes of lain and honored ( a...
source codes of lain and honored ( ass ). Contribute to enlarged/honored-bot development by creating an account on GitHub.
1 Reply
d.js toolkit
d.js toolkitā€¢8mo ago
- What's your exact discord.js npm list discord.js and node node -v version? - Not a discord.js issue? Check out #other-js-ts. - Consider reading #how-to-get-help to improve your question! - Explain what exactly your issue is. - Post the full error stack trace, not just the top part! - Show your code! - Issue solved? Press the button! - āœ… Marked as resolved by OP
Want results from more Discord servers?
Add your server