Replit works initially, then breaks

Tell us what’s happening:
Initially, the mongo replit boilerplate will work just fine, then after a while when i restart it to integrate updates to the code, it will throw out an error. It will do this even if I haven’t altered the code, and trying to revert to earlier versions doesn’t seem to work.

Error Output
npm ERR! errno 1
npm ERR! fcc-mongo-mongoose-challenges@0.0.1 start: node server.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the fcc-mongo-mongoose-challenges@0.0.1 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! /home/runner/.npm/_logs/2022-03-24T07_31_23_891Z-debug.log
exit status 1

Your browser information:

Windows 11x64, Chrome

Challenge: Install and Set Up Mongoose

Link to the challenge:

If you provide a link to the repl, you might be able to get a better answer.

When I fork your repl and run it, I see this in the console:

> fcc-mongo-mongoose-challenges@0.0.1 start /home/runner/boilerplate-mongomongoose-4
> node server.js

  johnCena = new Person({name: "John Cena", age: 33, favoriteFoods ["vegan stuff", "vegan things"]});

SyntaxError: Unexpected token '['

It is trying to tell you what the problem is. I think you’re missing a colon there.

Alright, made that change and it seems to be working now. Don’t I feel silly.

Silly mistakes are part of developing. You just become a better detective and get better at tracking them down.

Thanks Kevin. As long as we’re here, I’m having trouble diagnosing the error on a later lesson. replit link is the same, though I’ve made some changes.

Delete Many Documents with model.remove()

(node:1015) [MONGODB DRIVER] Warning: collection.remove is deprecated. Use deleteOne, deleteMany, or bulkWrite instead.
SyntaxError: Unexpected token o in JSON at position 1
at JSON.parse ()
at /home/runner/boilerplate-mongomongoose-1/server.js:346:29
at /home/runner/boilerplate-mongomongoose-1/node_modules/mongoose/lib/model.js:4999:18
at processTicksAndRejections (internal/process/task_queues.js:79:11)
^Csignal: interrupt

You should start a thread for that. Btoff the top ofmy head that looks like what happns when you try to parse something that is already an object. Log it and the type out to see.