Cannot find a module that I didn’t even require in package.json?

javascript
discord
#1

I’m working on a Discord bot, which was working fine a week ago (I didn’t change anything from then). For some reason, now it’s giving me the following error, and preventing my bot from coming online, or any code from running:

internal/modules/cjs/loader.js:584
^throw err;

Error: Cannot find module 'on-finished'

Could somebody help? I don’t use this module, nor do I know what it does. I just want my bot to go back online without errors :slightly_smiling_face:

Project here

#2

Hey @insertLenny, welcome to the Glitch forum!

This often indicates a problem with installing your node modules when your project starts up. You might try running enable-pnpm in the console to see if that helps resolve it.

#3

Oh, one thing I neglected to touch on; this package is probably something that’s being required by a package in your dependencies.

#4

Running enable-pnpm fixed it, thanks!

1 Like