0

I am just running npx create-react-app my-app and getting the following error :

Creating a new React app in D:\Other computers\My Laptop\Programming [P]\Web Development\Projects\my-portfolio\my-app.

Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts with cra-template...

npm ERR! code EEXIST
npm ERR! syscall mkdir
npm ERR! path D:\Other computers\My Laptop\Programming [P]\Web Development\Projects\my-portfolio\my-app\node_modules\.staging
npm ERR! errno -4075
npm ERR! EEXIST: file already exists, mkdir 'D:\Other computers\My Laptop\Programming [P]\Web Development\Projects\my-portfolio\my-app\node_modules\.staging'
npm ERR! File exists: D:\Other computers\My Laptop\Programming [P]\Web Development\Projects\my-portfolio\my-app\node_modules\.staging
npm ERR! Remove the existing file and try again, or run npm
npm ERR! with --force to overwrite files recklessly.

I have tried:

  • Uninstall and then install Node.js
  • Updated npm and npx
  • Installed create-react-app globally and then again tried to create app
  • tried npm cache clean

Please help !

  • 1
    Did you try `npx create-react-app my-app --force` as it suggests? Or running it with a name not already used in the current folder – iunfixit Sep 14 '21 at 15:38

2 Answers2

0

If you don't want to overwrite the contents of my-app directory, you can always choose a different name for your react-app. Something like this should work:

npx create-react-app myapp

However, if you are not bothered about the already existing directory you can do:

npx create-react-app my-app --force

Ghouse Mohamed
  • 387
  • 4
  • 10
  • I don't have a directory already named my-app, so how could I overwrite it ? – Ankit Bhardwaj Sep 17 '21 at 18:24
  • Hmm that's interesting. Trying removing by running `sudo rm -rf my-app`, maybe fixes the problem? – Ghouse Mohamed Sep 18 '21 at 19:25
  • I have a doubt. The folder that I am trying to make my react app inside, doesn't exists on my hard disk / ssd . It is on my cloud storage, Gdrive. I access it using a app called backup and sync by Google. Does that have anything to do with it ? – Ankit Bhardwaj Sep 19 '21 at 19:22
0

Try npm cache clean --force. and I hope it good to go after that.