The provided mongoose instance is invalid

This error shows when I run node index.js

Try deleting your node modules folder and npm i

I deleted node modules and ran npm i ; then I ran node index.js and it gave me the following error:
Cannot find module ‘winston’. Please help me .

If it’s saying can’t find module npm uninstall winston and then npm i winston again. Maybe use a different version and check to make sure your code cause i know from the node course it’s depricated. I have a form post showing how you need to change winston if you’re using an older code example like on mosh’s node course.