# Facing problem with Node

**URL:** <https://forum.codewithmosh.com/t/facing-problem-with-node/14885>\
**Category:** Node\
**Created:** [September 2, 2022, 6:42pm UTC](https://forum.codewithmosh.com/t/facing-problem-with-node/14885 "2022-09-02T18:42:04Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![nav\_pb03](https://avatars.discourse-cdn.com/v4/letter/n/47e85d/32.png) [@nav\_pb03](https://forum.codewithmosh.com/u/nav_pb03)\
**Post date:** [September 2, 2022, 6:42pm UTC](https://forum.codewithmosh.com/t/facing-problem-with-node/14885/1 "2022-09-02T18:42:04Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![jmrunkle](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.codewithmosh.com/jmrunkle/32/3765_2.png) [@jmrunkle](https://forum.codewithmosh.com/u/jmrunkle)\
**Post date:** [September 2, 2022, 9:35pm UTC](https://forum.codewithmosh.com/t/facing-problem-with-node/14885/2 "2022-09-02T21:35:08Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![nav\_pb03](https://avatars.discourse-cdn.com/v4/letter/n/47e85d/32.png) [@nav\_pb03](https://forum.codewithmosh.com/u/nav_pb03)\
**Post date:** [September 3, 2022, 5:06am UTC](https://forum.codewithmosh.com/t/facing-problem-with-node/14885/3 "2022-09-03T05:06:17Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![jmrunkle](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.codewithmosh.com/jmrunkle/32/3765_2.png) [@jmrunkle](https://forum.codewithmosh.com/u/jmrunkle)\
**Post date:** [September 3, 2022, 6:05am UTC](https://forum.codewithmosh.com/t/facing-problem-with-node/14885/4 "2022-09-03T06:05:27Z")

</div>

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

```nohighlight
sudo chmod +w /data/db

```

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

```nohighlight
ls -al /data | grep db

```

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

---

<div class="post-metadata">

**Author:** ![nav\_pb03](https://avatars.discourse-cdn.com/v4/letter/n/47e85d/32.png) [@nav\_pb03](https://forum.codewithmosh.com/u/nav_pb03)\
**Post date:** [September 3, 2022, 6:21am UTC](https://forum.codewithmosh.com/t/facing-problem-with-node/14885/5 "2022-09-03T06:21:50Z")

</div>

Okay, I’ll try that. Thanks!

---

<div class="post-metadata">

**Author:** ![nav\_pb03](https://avatars.discourse-cdn.com/v4/letter/n/47e85d/32.png) [@nav\_pb03](https://forum.codewithmosh.com/u/nav_pb03)\
**Post date:** [September 3, 2022, 9:21am UTC](https://forum.codewithmosh.com/t/facing-problem-with-node/14885/6 "2022-09-03T09:21:59Z")

</div>

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

these are the results. Still not sorted ☹

---

<div class="post-metadata">

**Author:** ![jmrunkle](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.codewithmosh.com/jmrunkle/32/3765_2.png) [@jmrunkle](https://forum.codewithmosh.com/u/jmrunkle)\
**Post date:** [September 3, 2022, 3:26pm UTC](https://forum.codewithmosh.com/t/facing-problem-with-node/14885/7 "2022-09-03T15:26:03Z")

</div>

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:

```nohighlight
sudo mkdir -p /data/db

```

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

---

<div class="post-metadata">

**Author:** ![nav\_pb03](https://avatars.discourse-cdn.com/v4/letter/n/47e85d/32.png) [@nav\_pb03](https://forum.codewithmosh.com/u/nav_pb03)\
**Post date:** [September 3, 2022, 3:38pm UTC](https://forum.codewithmosh.com/t/facing-problem-with-node/14885/8 "2022-09-03T15:38:38Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![jmrunkle](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.codewithmosh.com/jmrunkle/32/3765_2.png) [@jmrunkle](https://forum.codewithmosh.com/u/jmrunkle)\
**Post date:** [September 3, 2022, 3:55pm UTC](https://forum.codewithmosh.com/t/facing-problem-with-node/14885/9 "2022-09-03T15:55:29Z")

</div>

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

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

```

Or have I misunderstood?

---

<div class="post-metadata">

**Author:** ![jmrunkle](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.codewithmosh.com/jmrunkle/32/3765_2.png) [@jmrunkle](https://forum.codewithmosh.com/u/jmrunkle)\
**Post date:** [September 3, 2022, 3:57pm UTC](https://forum.codewithmosh.com/t/facing-problem-with-node/14885/10 "2022-09-03T15:57:46Z")

</div>

I gather this StackOverflow answer is the most comprehensive:

> <https://stackoverflow.com/questions/58283257/mongodb-cant-find-data-directory-after-upgrading-to-mac-os-10-15-catalina>

---

<div class="post-metadata">

**Author:** ![nav\_pb03](https://avatars.discourse-cdn.com/v4/letter/n/47e85d/32.png) [@nav\_pb03](https://forum.codewithmosh.com/u/nav_pb03)\
**Post date:** [September 3, 2022, 4:11pm UTC](https://forum.codewithmosh.com/t/facing-problem-with-node/14885/11 "2022-09-03T16:11:05Z")

</div>

Yes, you are correct on that!

---

<div class="post-metadata">

**Author:** ![Viktrix](https://avatars.discourse-cdn.com/v4/letter/v/b3f665/32.png) [@Viktrix](https://forum.codewithmosh.com/u/Viktrix)\
**Post date:** [September 7, 2022, 9:48am UTC](https://forum.codewithmosh.com/t/facing-problem-with-node/14885/12 "2022-09-07T09:48:33Z")

</div>

Follow steps on documentation not the video
