I was following the “How to Use MERN Stack: A Complete Guide” and got stuck at the Server API Endpoints section. How To Use MERN Stack: A Complete Guide | MongoDB
I am getting the following error when I try running “node server.mjs”
/Users/name/Desktop/mern/server/node_modules/mongodb-connection-string-url/lib/index.js:86
throw new MongoParseError('Invalid scheme, expected connection string to start with "mongodb://" or "mongodb+srv://"');
^
MongoParseError: Invalid scheme, expected connection string to start with "mongodb://" or "mongodb+srv://"
at new ConnectionString (/Users/name/Desktop/mern/server/node_modules/mongodb-connection-string-url/lib/index.js:86:19)
at parseOptions (/Users/name/Desktop/mern/server/node_modules/mongodb/lib/connection_string.js:191:17)
at new MongoClient (/Users/name/Desktop/mern/server/node_modules/mongodb/lib/mongo_client.js:48:63)
at file:///Users/name/Desktop/mern/server/db/conn.mjs:10:16
at ModuleJob.run (node:internal/modules/esm/module_job:194:25)
Node.js v19.4.0
I have followed the tutorial completely as I am very new to MERN, so I am not sure what I am doing wrong as my code is the same as in the tutorial.