Express Local Library - PopulateDB command not working

Following the Express Local Library tutorial. I’m at the very end of this page where I’m attempting to run node populatedb <my mongodb url>. When I open up my local library project locally and run the command, it spits out [1] 10289, and that’s it.

It says to then check my local_library DB in MongoDB Atlas and I should see individual collections of Books, Authors, etc. I see nothing, though.

Am I doing something wrong? Here’s what I type in when running the script (my username is odin and my password is voAkUlE2D5qUQIob. Database name is local_library.

node populatedb mongodb+srv://odin:voAkUlE2D5qUQIob@cluster0.lcab9.mongodb.net/local_library?retryWrites=true&w=majority

Hi @JD_F and welcome to the community :wave:

Unfortunately I haven’t worked with Express myself, yet. I’m not sure if @justsomeone has some experience with it. Maybe they can help. :man_shrugging:

Nevertheless I wish you a nice day,
Michael

1 Like

Hello @mikoMK and @JD_F

sorry for late replay but i did not read any server side course here

but if i am allowed to guess i would use what @horusofoz technique that the issue cold be related to the version you used

check this one

so check the package file that you have in your node project folder and compare each dependency and it’s version with what in the working version of it here https://github.com/mdn/express-locallibrary-tutorial/blob/master/package.json

if you found different in version then try to rebuild the project with the exact version of tools if it run fine then either one or more or at worst all new version has issue with some of the code used

sorry for not giving you answer about your issue but hope that help

and have a nice day for both of you :slight_smile:

1 Like

Hi @justsomeone, thanks for the reply.

Updated my package.json, deleted node_modules and package.json then re-installed node_modules. Still facing the same issue.

you very welcome
could you :

  1. create new folder which will be your project folder
  2. how did you install the module for example
    did you run this
    npm install mongoose
    or
    npm install mongoose@5.10.7

there a problem on which one you should use i guess this would lead to issue cause database driver should be compatible with the database version so for mysql database you can not use driver version intended to be used with mysql 8 with database version 5.7 or the opposite
so install this the normal way as
npm install mongoose

but for the async do it this way
npm install async@3.2.0

and you get the version from here https://github.com/mdn/express-locallibrary-tutorial/blob/master/package.json

not sure what else could be the cause as i did not read it before

sorry for not able to give much help