MongoDB: Cannot find module '/home/runner/boilerplate-mongomongoose/index.js'

Tell us what’s happening:

i created a
MongoDB cluster at

added a MONGO_URI with
my URL as Value


yes i replaced

changed source at the app.js

mongoose.connect(MONGO_URI, { useNewUrlParser: true, useUnifiedTopology: true });

and also tried

let mongoose = require('mongoose');
mongoose.connect(MONGO_URI, { useNewUrlParser: true, useUnifiedTopology: true });

was cloning the GitHub source to my repl and pressed run

and gut this error:

i got error:

Error: Cannot find module ‘/home/runner/boilerplate-project-urlshortener/index.js’

Your code so far

i tried to fix with:

means open

open .replit and run it

but same error.

Your browser information:

User Agent is: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:109.0) Gecko/20100101 Firefox/110.0

Challenge: MongoDB and Mongoose - Install and Set Up Mongoose

Link to the challenge:
its from

thanks i changed.

now i get other error:

ReferenceError: MONGO_URI is not defined
at Object. (/home/runner/boilerplate-mongomongoose/myApp.js:4:18)

but i added it in the Secrets (without ’ or " )

its in the Secrets tab.

ahhh yes. ists not referenzed. seems i forgot it

No you did not. I just looked at your replit for the Express challenges and you did it correctly in your GET /json route.

thanks and sorry :pray:

one of my problems is that i often mix to many program-styles and languages in my mind. and i usually use jetbrains - tools :wink: its nearly like a auto-correction-tool

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