MongoDB and Mongoose - Create a Model - Help

Hi,

I am trying to create a model in the " MongoDB and Mongoose - Create a Model" module.

I keep getting an error at the logs which says :

Error: Cannot find module ‘express’
12:16 AM
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:582:15)
12:16 AM
at Function.Module._load (internal/modules/cjs/loader.js:508:25)
12:16 AM
at Module.require (internal/modules/cjs/loader.js:637:17)
12:16 AM
at require (internal/modules/cjs/helpers.js:22:18)
12:16 AM
Jump Toat Object. (/app/server.js:6:15)
12:16 AM
at Module._compile (internal/modules/cjs/loader.js:701:30)
12:16 AM
at Object.Module._extensions…js (internal/modules/cjs/loader.js:712:10)
12:16 AM
at Module.load (internal/modules/cjs/loader.js:600:32)
12:16 AM
at tryModuleLoad (internal/modules/cjs/loader.js:539:12)
12:16 AM
at Function.Module._load (internal/modules/cjs/loader.js:531:3)

I don’t know why I am getting this error. I have tried everything.

The link to my glitch:

Any help would be appreciated!

Thanks.

It seems Glitch has not installed Express. You can open the terminal and do this yourself with this:

pnpm install express

Hope this helps

Hey,

Thanks for the info. Apparently it only works with old version of Mongoose, so I changed my version to 3.3.2 and it works.