# React Vite Installation Error

**URL:** <https://forum.codewithmosh.com/t/react-vite-installation-error/23624>\
**Category:** Uncategorized\
**Created:** [November 14, 2023, 1:49am UTC](https://forum.codewithmosh.com/t/react-vite-installation-error/23624 "2023-11-14T01:49:37Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Terrence](https://avatars.discourse-cdn.com/v4/letter/t/cdc98d/32.png) [@Terrence](https://forum.codewithmosh.com/u/Terrence)\
**Post date:** [November 14, 2023, 1:49am UTC](https://forum.codewithmosh.com/t/react-vite-installation-error/23624/1 "2023-11-14T01:49:37Z")

</div>

![image](https://us1.discourse-cdn.com/flex020/uploads/codewithmosh/original/2X/f/f86a82eaf6c9243bdfeeae659611d19d362bd17c.png)

---

<div class="post-metadata">

**Author:** ![Programmist](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.codewithmosh.com/programmist/32/7006_2.png) [@Programmist](https://forum.codewithmosh.com/u/Programmist)\
**Post date:** [November 14, 2023, 5:54am UTC](https://forum.codewithmosh.com/t/react-vite-installation-error/23624/2 "2023-11-14T05:54:59Z")

</div>

Hi Terrence. Have you ever run the `npm` command prefixed with `sudo`? If so you should generally avoid this as it will create files and directories owned by root that will be inaccessible to your login account. When you run `ls -l /Users/terrence/.npm`, does the root user own the files and directories within?

For instance, something like this:

```auto
$ls -l /Users/terrence/.npm
drwxr-xr-x 5 root wheel 160 May 31 2020 _cacache
drwxr-xr-x 2 root wheel 64 Mar 6 2021 _locks
...

```

If you see `root wheel` (on MacOS) then you will need to use the `chown` command to change the ownership of `.npm` and all of its contents to your user. Assuming you’re on MacOS, run this and enter your login account password when prompted:

```auto
sudo chown -R terrence:staff /Users/terrence/.npm

```

Hope this helps.
