Categories
JavaScript Answers

How to fix “ERROR: dbpath (/data/db) does not exist.” with Node MongoDB?

Spread the love

To fix "ERROR: dbpath (/data/db) does not exist." with Node MongoDB, we should make sure the /data/db folder exists.

To do this, we run

sudo mkdir -p /data/db/

to create the /data/db/ folder.

Then we set the current user as the owner of the folder with

sudo chown `id -u` /data/db

By John Au-Yeung

Web developer specializing in React, Vue, and front end development.

Leave a Reply

Your email address will not be published. Required fields are marked *