I start the Mongodb course but stuck with these errors
-
“mongoose version ^5.11.15” dependency should be in package.json
-
Failed:“mongoose” should be connected to a database
meanwhile my code in package.json is already like this (with comma because it’s not the end)
"dependencies": {
"body-parser": "^1.15.2",
"dotenv": "^16.0.3",
"express": "^4.12.4",
"mongodb": "^3.0.0",
"mongoose": "^5.11.15"
},
and also i already connect the project with the db in myApp.js:
require('dotenv').config();
const mongoose = require('mongoose')
mongoose.connect(process.env.MONGO_URI, { useNewUrlParser: true, useUnifiedTopology: true });
this is my env file:
this is my shell, the app is working well but still dont wanna pass in freecodecamp test:
“Your app is listening on port 3000” is in the shell
Is there anyone who is also stuck like this?