node.js – MongoDB data/db not found

node.js – MongoDB data/db not found

You need to create this directory as root

Either you need to use sudo , e.g. sudo mkdir -p /data/db

Or you need to do su – to become superuser, and then create the directory with mkdir -p /data/db

You can also give this command sudo mongod --dbpath=/var/lib/mongodb.
Open another terminal and run your mongod.

node.js – MongoDB data/db not found

It worked for me.
try: sudo service mongod start

Leave a Reply

Your email address will not be published.