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
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!
Follow steps on documentation not the video