Install and Set Up Mongoose

the key is MONGO_URI and the values is mondodb+srv://sofia:mmmmmmm@cluster.mongodb.net/freecodecamp?retryWrites=true&w=majority that is example set up

but now I have a different error  npm run start

fcc-mongo-mongoose-challenges@0.0.1 start
node server.js

Your app is listening on port 3000
/home/runner/boilerplate-mongomongoose/node_modules/mongodb/lib/core/uri_parser.js:50
if (result.hostname.split(‘.’).length < 3) {
^

Please post the full error message.

Also, is this on Replit or locally?

On Replit you should not use quotes "" around the value for the secrets.


On Replit, under the secrets, if you click the Edit as JSON button you should see a single string around the key/value (Replit adds the quotes for you)

{
  "MONGO_URI": "mondodb+srv://sofia:mmmmmmm@cluster.mongodb.net/freecodecamp?retryWrites=true&w=majority"
}

If you see a double-quoted string for the key or value remove one of the pairs.

fixed that part by deleting the username and creating my own password. now that I am up and running this is the issue I have and the console error
Error: Cannot find module ‘/home/runner/boilerplate-mongomongoose/index.js’
Require stack:

  • /nix/store/qpnf0dafrfsbcwb4z7cphjm0dff0vl7l-prybar-nodejs-0.0.0-e0d9a52/prybar_assets/nodejs/module-context-hook.js
  • /tmp/prybar-nodejs-017917043.js
    at Module._resolveFilename (node:internal/modules/cjs/loader:995:15)
    at Function.resolve (node:internal/modules/cjs/helpers:109:19)
    Hint: hit control+c anytime to enter REPL.

Thank you for all the help you provided me finally I figure it and I have learn a lot from my learning journey. I appreciate you and you are wonderful, you aid me twice now.

Restarting the server fixed it for me.