bradtraversy / proshop_mern

Shopping cart built with MERN & Redux
1.99k stars 1.18k forks source link

app crashed when running the server and client using 'npm run dev' #116

Closed AshTech25 closed 3 years ago

AshTech25 commented 3 years ago

Error: The uri parameter to openUri() must be a string, got "undefined". Make sure the first parameter to mongoose.connect() or mongoose.createConnection() is a string. [nodemon] app crashed Github error

tanishqdaiya commented 3 years ago

Environment Variables

Did you make an ENV file in the root directory?

tanishqdaiya commented 3 years ago

Make an ENV File

Make an ENV File in root directory and fill the values.

basir commented 3 years ago

create a file named .env and enter this line: MONGO_URI=your db connection in mongodb atlas

then restart the server to fix this issue.

please ask this type of questions in Udemy Q/A. Only create an issue for an error in the repo not in your code.