简体   繁体   中英

I'm trying to install react but I keep getting an 'Error: EPERM: operation not permitted'

I've been trying to install react using npx create-react-app./ That didn''t work so I tried npm init react-app my-app and it still didn't work. The error im getting says

Error: EPERM: operation not permitted, mkdir 'C:\Users\Yanki' command not found: create-react-app PS C: \Users\Yanki XXIV\Desktop\E-commerce-practice>

I think you will need to have version of Node>=10.16 and version of NPM >=5.6 If this is still not resolved then try this:

  1. Clean cache with
  • npm cache clean --force
  1. Install the latest version of NPM globally as admin:
  • npm install -g npm@latest --force

3.clean cache with

  • npm cache clean --force

I've never seen the./ inclusion when creating a react app, but that's not to say it's wrong... maybe just follow the docs here and use: npx create-react-app my-app

I found this answer it helped me so I hope this helps. Below is the link https://stackoverflow.com/a/65516052/8195649

Go to c:/users open command prompt and run dir /x check shorter name you found with dir/x as shown in image and run npm config set cache "C:/Users/<shortname-you-found-with-dir/x>/AppData/Roaming/npm-cache" --global

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM