gitpod /workspace/boilerplate-mongomongoose (main) $ npm run start
> fcc-mongo-mongoose-challenges@0.0.1 start
> node server.js
Your app is listening on port 3000
db connection succesful
GET
GET
Those 2 gets are the test running from what I get.
And this is the result on the tester.
[PASS] “mongoose version ^5.11.15” dependency should be in package.json
[FAILED]:“mongoose” should be connected to a database
You should not update the mongoose dependency, as its initial version is one of the requirements (has to be ^5.11.15).
someDependency is not a package name, it is a placeholder used as an example of “some dependency” (i.e. any dependency it could possibly be).
The issue is not with mongoose or the code you posted so it must be something else. The connection log and the GET suggests that you are connected, and the test is hitting the endpoint.
Try submitting it in Incognito mode or a different browser.
I would complete it locally, but you can also try using Replit.
I don’t see your callback log for the connection. On Replit you have to use the secrets for the connection string, not an env file, and you have to submit the URL you get from clicking the “New tab” button.
Don’t update the dependencies.
The article I linked to explain how to run it locally.
Install Git and Node.js
Clone the repo down (or just download it).
Create the env file with your connection string and add your code (remember to use dotenv).
Run npm i && npm start in the terminal from the root folder.
Still get the same error and now I can’t see a connection to the DB. I have Git and Node.js, I will try local install tomorrow since I was still unable to make it work.
Sorry, but I’m super ignorant and need a bit of help when you tell me to do something, please try to be as specific as you can. Thank you and sorry for bothering so much
Also tried changing my mongo_uri addres:
FROM
MONGO_URI=‘mongodb+srv://***:***c@mongodbexercise.oht5rwr.mongodb.net/?retryWrites=true&w=majority&appName=MongodbExercise’
TO
MONGO_URI=‘mongodb+srv://***:***c@mongodbexercise.oht5rwr.mongodb.net/?retryWrites=true&w=majority’
which I saw some other youtube videos used as the address. This reproduced the same error message that I got in github and replit.