I'm trying to install React for the first time and I'm getting the following error from my terminal:
~ % npm install -g create-react-app
npm WARN deprecated [email protected]: This version of tar is no longer supported, and will not receive security updates. Please upgrade asap.
npm ERR! code EEXIST
npm ERR! syscall mkdir
npm ERR! path /Users/shibazhussain/.npm/_cacache/content-v2/sha512/12/7c
npm ERR! errno -13
npm ERR! EACCES: permission denied, mkdir '/Users/shibazhussain/.npm/_cacache/content-v2/sha512/12/7c'
npm ERR! File exists: /Users/shibazhussain/.npm/_cacache/content-v2/sha512/12/7c
npm ERR! Remove the existing file and try again, or run npm
npm ERR! with --force to overwrite files recklessly.
npm ERR! A complete log of this run can be found in: /Users/shibazhussain/.npm/_logs/2024-03-29T16_46_46_875Z-debug-0.log
shibazhussain@Shibazs-MacBook-Air ~ %
I tried the following so far:
- Using the clear cache command
- tried using npx instead of npm
- tried to uninstall react app before installing
- tried a $(whoami) / sudo chown command
- --force overwrite