MongoDB and Mongoose - Install and Set Up Mongoose

Tell us what’s happening:
Describe your issue in detail here.
I keep getting this message
“// running tests
“mongoose version ^5.11.15” dependency should be in package.json
“mongoose” should be connected to a database
// tests completed”

Mongoose is installing fine but the test doesn’t like the version.
And all the different forum advice doesn’t seem to fix my database not connecting so any advice would be lovely.
Your project link(s)

solution: boilerplate-express - Node.js Repl - Replit

Your browser information:

User Agent is: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/ Safari/537.36

Challenge: MongoDB and Mongoose - Install and Set Up Mongoose

Link to the challenge:

Yes but not initially. Initially I just required it in and it was added to the json file after I saved and pressed ctrl+enter.
When I ran the test doing the “i completed this” I got the same message and an older version of mongoose was there.
I’ve tried hardcoding the version by manually typing in the ^5.11.15 bit but that doesn’t pass even that specific test. Later tried requiring in the mongodb, and adding that manually to the json when that didn’t work, finanally I installed mongodb and did the same with the mongoose when that didn’t work.
It would be nice to be able to run a console log but replit doesn’t seem to show it and I don’t know why, I have a small amount of TDD experience that centres around jest and console logging all-the-things so … I’m a little bit lost as to how to narrow down what is wrong especially when not being able to take a look at the test themselves.

And of course in all cases, when I submit the name what comes back is
{“name”:“undefined undefined”}

Actually I just noticed you are using the wrong boilerplate. You are using the same one you started with the Node and Express challenges.

If you read the instructions, you will see:

This set of challenges uses a different boilerplate that has files the tests needs to work properly.

…Oh my that’s embarrassing.
Thank you!

Yup totally passed the first test.
I’m a little red-faced but very happy with the result. Thank you so much for helping me Randall!

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.