seeh
March 10, 2023, 7:17pm
1
Tell us what’s happening:
i created a
MongoDB cluster at https://cloud.mongodb.com
added a MONGO_URI with
my URL as Value
mongodb+srv://<my_cluster_name>:@cluster0.enwxxip.mongodb.net /?retryWrites=true&w=majority
yes i replaced
<my_cluster_name>
changed source at the app.js
https://replit.com/@sl5net/boilerplate-mongomongoose
to:
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:
Hi all
I get this error when using the debugger:
“Error: Cannot find module ‘/home/runner/boilerplate-project-urlshortener/index.js’”
How do I fix this?
Thanks for your time
Jaime
Your browser information:
User Agent is: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.107 Safari/537.36
Challenge: URL Shortener Microservice
Link to the challenge:
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:
Learn to Code — For Free
seeh
March 10, 2023, 7:25pm
3
https://replit.com/@sl5net/boilerplate-mongomongoose
its from
https://github.com/freeCodeCamp/boilerplate-mongomongoose
seeh
March 10, 2023, 7:41pm
5
camperextraordinaire:
.replit file and change index.js to server.js, because the app uses server.js
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 " )
seeh
March 10, 2023, 7:47pm
9
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.
seeh
March 10, 2023, 7:49pm
11
process.env.
thanks and sorry
one of my problems is that i often mix to many program-styles and languages in my mind. and i usually use jetbrains - tools its nearly like a auto-correction-tool
system
Closed
September 9, 2023, 7:50am
12
This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.