Someone can check and show where am have done wrong now guys am lost

Tell us what’s happening:

Your code so far

Your browser information:

User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.66 Safari/537.36.

Challenge: Install and Set Up Mongoose

Link to the challenge:

Without some reference to your code, some idea what you’re doing, we can’t even guess what’s going wrong.

What have you tried? What messages are you seeing?

“mongoose” should be connected to a database

:water_buffalo::bookmark: Your app is listening on port 3000

10:52 AM

(node:9027) DeprecationWarning: current Server Discovery and Monitoring engine is deprecated, and will be removed in a future version. To use the new Server Discover and Monitoring engine, pass option { useUnifiedTopology: true } to the MongoClient constructor.

10:52 AM

6 minutes ago

(node:9027) UnhandledPromiseRejectionWarning: MongoNetworkError: failed to connect to server [cluster0-shard-00-01.ixr7q.mongodb.net:27017] on first connect [MongoError: bad auth : Authentication failed.

10:52 AM

at Connection.messageHandler (/rbd/pnpm-volume/6000f7b6-a8ad-439c-ab6c-ffa8bf0069ba/node_modules/.registry.npmjs.org/mongodb/3.6.3/node_modules/mongodb/lib/core/connection/connection.js:359:19)

10:52 AM

at Connection.emit (events.js:196:13)

10:52 AM

at processMessage (/rbd/pnpm-volume/6000f7b6-a8ad-439c-ab6c-ffa8bf0069ba/node_modules/.registry.npmjs.org/mongodb/3.6.3/node_modules/mongodb/lib/core/connection/connection.js:451:10)

10:52 AM

at TLSSocket. (/rbd/pnpm-volume/6000f7b6-a8ad-439c-ab6c-ffa8bf0069ba/node_modules/.registry.npmjs.org/mongodb/3.6.3/node_modules/mongodb/lib/core/connection/connection.js:620:15)

10:52 AM

at TLSSocket.emit (events.js:196:13)

10:52 AM

at addChunk (_stream_readable.js:290:12)

10:52 AM

at readableAddChunk (_stream_readable.js:271:11)

10:52 AM

at TLSSocket.Readable.push (_stream_readable.js:226:10)

10:52 AM

at TLSWrap.onStreamRead (internal/stream_base_commons.js:166:17) {

10:52 AM

ok: 0,

10:52 AM

code: 8000,

10:52 AM

codeName: ‘AtlasError’,

10:52 AM

name: ‘MongoError’

10:52 AM

}]

10:52 AM

at Pool. (/rbd/pnpm-volume/6000f7b6-a8ad-439c-ab6c-ffa8bf0069ba/node_modules/.registry.npmjs.org/mongodb/3.6.3/node_modules/mongodb/lib/core/topologies/server.js:438:11)

10:52 AM

at Pool.emit (events.js:196:13)

10:52 AM

at /rbd/pnpm-volume/6000f7b6-a8ad-439c-ab6c-ffa8bf0069ba/node_modules/.registry.npmjs.org/mongodb/3.6.3/node_modules/mongodb/lib/core/connection/pool.js:562:14

10:52 AM

at /rbd/pnpm-volume/6000f7b6-a8ad-439c-ab6c-ffa8bf0069ba/node_modules/.registry.npmjs.org/mongodb/3.6.3/node_modules/mongodb/lib/core/connection/pool.js:1009:9

10:52 AM

at callback (/rbd/pnpm-volume/6000f7b6-a8ad-439c-ab6c-ffa8bf0069ba/node_modules/.registry.npmjs.org/mongodb/3.6.3/node_modules/mongodb/lib/core/connection/connect.js:75:5)

10:52 AM

at /rbd/pnpm-volume/6000f7b6-a8ad-439c-ab6c-ffa8bf0069ba/node_modules/.registry.npmjs.org/mongodb/3.6.3/node_modules/mongodb/lib/core/connection/connect.js:147:27

10:52 AM

at /rbd/pnpm-volume/6000f7b6-a8ad-439c-ab6c-ffa8bf0069ba/node_modules/.registry.npmjs.org/mongodb/3.6.3/node_modules/mongodb/lib/core/auth/scram.js:185:14

10:52 AM

at _callback (/rbd/pnpm-volume/6000f7b6-a8ad-439c-ab6c-ffa8bf0069ba/node_modules/.registry.npmjs.org/mongodb/3.6.3/node_modules/mongodb/lib/core/connection/connection.js:328:7)

10:52 AM

at Connection.messageHandler (/rbd/pnpm-volume/6000f7b6-a8ad-439c-ab6c-ffa8bf0069ba/node_modules/.registry.npmjs.org/mongodb/3.6.3/node_modules/mongodb/lib/core/connection/connection.js:359:9)

10:52 AM

at Connection.emit (events.js:196:13)

10:52 AM

at processMessage (/rbd/pnpm-volume/6000f7b6-a8ad-439c-ab6c-ffa8bf0069ba/node_modules/.registry.npmjs.org/mongodb/3.6.3/node_modules/mongodb/lib/core/connection/connection.js:451:10)

10:52 AM

at TLSSocket. (/rbd/pnpm-volume/6000f7b6-a8ad-439c-ab6c-ffa8bf0069ba/node_modules/.registry.npmjs.org/mongodb/3.6.3/node_modules/mongodb/lib/core/connection/connection.js:620:15)

10:52 AM

at TLSSocket.emit (events.js:196:13)

10:52 AM

at addChunk (_stream_readable.js:290:12)

10:52 AM

at readableAddChunk (_stream_readable.js:271:11)

10:52 AM

at TLSSocket.Readable.push (_stream_readable.js:226:10)

10:52 AM

(node:9027) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)

10:52 AM

(node:9027) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

/**********************************************

    1. FCC Mongo & Mongoose Challenges
  • ==================================
    ***********************************************/

/** # MONGOOSE SETUP #
/* ================== */

/** 1) Install & Set up mongoose */

// Add mongodb and mongoose to the project’s package.json. Then require
// mongoose. Store your mLab database URI in the private .env file
// as MONGO_URI. Connect to the database using mongoose.connect(<Your URI>)
const mongoose=require(‘mongoose’);
mongoose.connect(process.env.MONGO_URI, { useNewUrlParser: true, useUnifiedTopology: true});

/** # SCHEMAS and MODELS #

"description": "A boilerplate project",
  "main": "server.js",
  "scripts": {
    "start": "node server.js"
  },
  "dependencies": {
    "express": "^4.12.4",
    "body-parser": "^1.15.2",
    "mongodb": "*",
    "mongoose": "*"
  },
  "engines": {
    "node": "12.*"
  },
  "repository": {
    "type": "git",
    "url": "https://hyperdev.com/#!/project/welcome-project"
  },
  "keywords": [
    "node",
    "hyperdev",
    "express"
  ],
  "license": "MIT"
}

Hello there,

Please, instead of many replies to yourself with unformatted text, include a link to your project code.


[MongoError: bad auth : Authentication failed.

This error suggests you have incorrect credentials in your MONGO_URI. That is, your password or username could be incorrect. Double-check these.

I’ve edited your post for readability. When you enter a code block into a forum post, please precede it with a separate line of three backticks and follow it with a separate line of three backticks to make it easier to read.

You can also use the “preformatted text” tool in the editor (</>) to add backticks around text.

See this post to find the backtick on your keyboard.
Note: Backticks (`) are not single quotes (’).