internal/modules/cjs/loader.js:716
throw err;
^
Error: Cannot find module 'ytdl-core'
Require stack:
- /app/index.js
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:713:15)
at Function.Module._load (internal/modules/cjs/loader.js:618:27)
at Module.require (internal/modules/cjs/loader.js:771:19)
at require (internal/modules/cjs/helpers.js:68:18)
at Object.<anonymous> (/app/index.js:17:14)
at Module._compile (internal/modules/cjs/loader.js:868:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:879:10)
at Module.load (internal/modules/cjs/loader.js:731:32)
at Function.Module._load (internal/modules/cjs/loader.js:644:12)
at Function.Module.runMain (internal/modules/cjs/loader.js:931:10) {
code: 'MODULE_NOT_FOUND',
Hey @ScottHJStenkilsson I’m pretty sure your problem here is that you’re listing Node as a dependency. That creates a recursive problem with pnpm’s install process that means that Glitch has a hard time finding the modules where they’re expected to be.
You can remove Node from your dependency list and that should resolve the issue. If you require Node v12 you can set the value for node in the engines stanza to 12.x and we’ll use that version for your project.
We rely directly on the libraries.io API for the Add Packages functionality, but I agree it makes sense not to have node in that list. Thanks for pointing that out, @dangtu!
New update:
Maybe your problem lies in fs module. That module is not exist. It is a placeholder in npm. But you use it so it very likey it would cause an error. Anyway, please check your dependencies and make sure no built-in packages were added.
Your error was something to do with the version of node you were using, so I lowered it to version: 10.15.3.
Then another error started appearing: Error: Cannot find module '../build/better_sqlite3.node'Which I simply fixed by doing rm -rf shrinkwrap.yaml && enable-pnpm
Your bot has started up fine now and I do not see any other problems!