Facing problem with Node

Hi Mosh,
I have been an old subscriber of your YouTube channel and your course. Earlier I have purchased your Javascript course and it was great so I bought the node.js course as well. However, lately once I have reached the mongodb section I’m unable to proceed since due to new updates in MacOS I’m unable to install mongodb and use it my system by following the steps shared there.

So please either update the course or redirect me to a video that explains the installation for the same in the latest OS since /data/db file is read only for me

Perhaps it would help if you shared the exact command you get stuck on and what error output you are getting? The exact error output is usually helpful for debugging.


Post installing mongodb. When I enter the command mkdir -p /data/db
It says /data/db file is ready only

We can try just adding the write bit to that directory:

sudo chmod +w /data/db

If that isn’t working perhaps you can copy paste the output of this command:

ls -al /data | grep db

That should tell us what the directory permissions are and may give us a clue.


Okay, I’ll try that. Thanks!

chmod: /data/db: No such file or directory
ls: /data: No such file or directory

these are the results. Still not sorted :frowning:

Huh, the error message saying it is readonly is obviously wrong if the directory does not exist at all. Try using sudo to make the directory:

sudo mkdir -p /data/db

Perhaps the root directory (/) is only writeable by the root user.

I just checked a youtube video. This is happening due to the latest macOS update. In which we have to /System/Volume/Data/data/db instead of the above command. It’s sorted now. Thanks

But I still believe Mosh needs to update the course to help newbies like me who are just starting out and are not familiar with the ins and outs that much due to lack of background in this field

So, to be clear, the solution was to run this command instead:

mkdir -p /System/Volume/Data/data/db

Or have I misunderstood?

I gather this StackOverflow answer is the most comprehensive:

Yes, you are correct on that!

1 Like

Follow steps on documentation not the video