Still unable to pass Install and Set Up Mongoose FCC

Tell us what’s happening:
I’ve done multiple changes: moved from to glitch then corrected typos created new database in MongoDB Atlas new password. Visited glitch forum found someone with same unresolved problem. Any suggestions are greatly appreciated.

Your project link(s)

solution: Glitch :・゚✧

Your browser information:

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/14.1.2 Safari/605.1.15

Challenge: Install and Set Up Mongoose

Link to the challenge:

Hi @llabrie !

You can try to add this code and check for yourself whether or not your mongo database is connected. Maybe this will help you nail down the issue.

// check for proper connection
const database = mongoose.connection;
database.on('error', console.error.bind(console, 'connection error: '));
database.once('open', () => {
    console.log('mongo database connected')

Hi! I appreciate your reply. I will check now and get back to you. THANKS

[quote=“jwilkins.oboe, post:2, topic:476322”]

const database = mongoose.connection;
database.on(‘error’, console.error.bind(console, 'connection error: '));
database.once(‘open’, () => {
console.log(‘mongo database connected’)

I get this error : events.js:174
      throw er; // Unhandled 'error' event     Is this the timeout line on server.js?

I just read the instructions which say to use those earlier versions but I wasn’t able to pass.

I’ll try to look into it again and see if I made a mistake somewhere with those earlier versions.

I was able to get it working on my with the versions from the instructions.

You wrote this in your package.json file

   "mongoose": "~5.4.0",
   "mongodb": "~3.6.0"

but when I installed mine my package.json file looked like this

   "mongodb": "^3.6.0",
   "mongoose": "^5.4.0"

These were the commands I ran.

npm i mongoose@5.4.0
npm i mongodb@3.6.0

See if that helps

If that doesn’t help, then it looks like there is an issue with your mongo uri string.

Does your password in the string have any special characters in it?

There have been people on the forum that had issues with their mongo uri strings and had to change it to a password without special characters so it could pass the test.

Thank you so much for taking the time to help! Really appreciate it I will try the options you suggest. Have a great day!

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