Can't run script of MongoDB Atlas URL using node to database
Obviously a super newbie but I have tried darn near everything and keep getting the same error message thrown. I've even deleted my database, cluster, organization and everything and remade them exactly the same but still to no avail. I'm uploading a screen shot but just in case I'll explain in text what is happening and what I'm trying to do so please bare with me :)
I'm currently following along with a MDN tutorial [Express Local Library Part 3 to be exact!] and am totally stumped on this current challenge. I've done everything correct, that I know of, so far. I made a database then a cluster with MongoDB Atlas and am now trying to upload my data from a file [populatedb.js] by command [node populatedb ] but it doesn't work at all. I've linked it to the apps.js file with the correct URL (or so I think?) and am just completely lost. Please someone help.
I'm getting this returned in the console: [ps removing personal credentials with elongated underscores :)] -MacBook-Air express-locallibrary-tutorial % node populatedb 'mongodb+srv://:_____________@cluster0.mhzo6.mongodb.net/local_library?retryWrites=true&w=majority' internal/modules/cjs/loader.js:905 throw err; ^
Error: Cannot find module '/Users/________/Desktop/express-locallibrary-tutorial/populatedb' at Function.Module._resolveFilename (internal/modules/cjs/loader.js:902:15) at Function.Module._load (internal/modules/cjs/loader.js:746:27) at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:76:12) at internal/main/run_main_module.js:17:47 { code: 'MODULE_NOT_FOUND', requireStack: [] }
PS I've tried single quotes, double quotes, and nothing and still to no avail. I'm sure it's something simple but I am code blind to it right now.
heres the MDN tutorial link too btw: https://developer.mozilla.org/en-US/docs/Learn/Server-side/Express_Nodejs/mongoose[enter image description here]1
from Recent Questions - Stack Overflow https://ift.tt/3Cv7tPb
https://ift.tt/eA8V8J
Comments
Post a Comment