admin管理员组

文章数量:1316974

I am making my first react app and running mand: npx create-react-app my-app and i am getting this error:

Error: EEXIST: file already exists, mkdir 'C:\Users\Deepak'

mand not found: create-react-app

Can anybody please help me to resolve this error?

I am making my first react app and running mand: npx create-react-app my-app and i am getting this error:

Error: EEXIST: file already exists, mkdir 'C:\Users\Deepak'

mand not found: create-react-app

Can anybody please help me to resolve this error?

Share Improve this question edited Apr 16, 2021 at 8:08 Klaassiek 2,9061 gold badge25 silver badges44 bronze badges asked Apr 15, 2021 at 18:44 061_Deepak Singh Rawat061_Deepak Singh Rawat 311 silver badge2 bronze badges
Add a ment  | 

4 Answers 4

Reset to default 6

Follow these steps, it will definitely work:

  1. npm uninstall -g create-react-app
  2. npm install -g create-react-app
  3. npx create-react-app the-name-of-your-app

I do have space in my UserName folder so I tried this run the mand

npm config edit

set the variable cache=C:\Users\{UserName} and save the file

This work in my case, hope it will help u too

It seems you have a my-app folder/directory in C:\Users\Deepak. Could you try as below?

npx create-react-app my-super-app

It seems you have a space in your users directory Deepak. That is the most mon reason for this type of error.

NPX uses C:\Users\[username]\AppData\Roaming\npm-cache while executing. It has a bug which prevents it from running if there is space in this path.

To remedy this problem you need to update the npm cache path by replacing the string after the space with ~1

E.g.

npm config set cache C:\Users\Deepak~1\AppData\Roaming\npm-cache

This will set npm cache path without the space.

After this if you run npx it should work fine without throwing any error.

NOTE: You might want to run this mand and the npx mand with administrative rights or you might get permission error

本文标签: javascriptusing createreactapp I get EEXIST file already existsStack Overflow