inventory-application
inventory-application copied to clipboard
throw new MongooseError
I am new to this development. I am tried to run your application during that time i got below error. please help what is the issue and how to resolve it?
D:\inventory-application\node_modules\mongoose\lib\connection.js:579
[0] throw new MongooseError('The uri
parameter to openUri()
must be a ' +
[0] ^
[0] Error [MongooseError]: 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.
[0] at new MongooseError (D:\inventory-application\node_modules\mongoose\lib\error\mongooseError.js:10:11)
[0] at NativeConnection.Connection.openUri (D:\inventory-application\node_modules\mongoose\lib\connection.js:579:11)
[0] at Mongoose.connect (D:\inventory-application\node_modules\mongoose\lib\index.js:333:15)
[0] at Object.
If I'm not mistaken, you must add the .env file that refers to the environment variables for the connection to the mongo database @anuvivin
If I'm not mistaken, you must add the .env file that refers to the environment variables for the connection to the mongo database @anuvivin
Yeah you're right, and I'm glad you replied I just saw this issue now.
Ok, for me it is my pleasure to answer, you could create a .env.example file to put all the necessary environment variables and when someone executes it locally put the values of their machine and thus not upload confidential data to github. Also if you allow me I can do a PR with that small change @moelashmawy
Ok, for me it is my pleasure to answer, you could create a .env.example file to put all the necessary environment variables and when someone executes it locally put the values of their machine and thus not upload confidential data to github. Also if you allow me I can do a PR with that small change @moelashmawy
sure you can do a PR and also i will update the REAME with the env vars, thank you for your following up
https://github.com/moelashmawy/inventory-application/pull/5 It's done, just accept it