Did you search for the error?
I assume you have to remove the
useCreateIndex option or downgrade.
just following the video on Youtube but got the error : Learn the MERN Stack - Full Tutorial (MongoDB, Express, React, Node.js) - YouTube
after 20 minutes
Can you please post a link to your project code?
I cloned your repo locally and when I put in my own MONGO uri, the server starts right up with no errors. My guess is your credentials are not valid or the username was not given read/write privileges which are needed.
Also, make sure not to put any space between the environment variable and the
= and the value assigned to it in your
Lastly, you should always make sure you add
.env to your
.gitignore file to keep it out of the repo (and its history). Here is a good article on removing .env from git history.
FYI - I hope you understand you can not use this code shown in the video for your submitted project to the Exercise Tracker certification project. The code for the project must be your own original work. Maybe that is not what you were planning, but wanted to let you know in case that was your goal.
Remember to gitignore the node_modules folder as well.
Unless the env file you are using has the port number (which it doesn’t on GitHub) you will use port 5000 and not 3000 for the backend and if you are running the React app it runs on port 3000 so it might look like you are connecting to the backend (in Insomnia) when it is just the frontend server you are hitting. This means you won’t see connection errors but routing errors.
Thank you so much, it worked!
Thank you so much, it worked! and I was not aware of the port.