0

I am trying to install react by npm but its giving me this error

error An unexpected error occurred: "EPERM: operation not permitted, copyfile 'C:\\Users\\Bilal\\AppData\\Local\\Yarn\\Cache\\v6\\npm-request-2.88.2-d73c918731cb5a87da047e207234146f664d12b3-integrity\\node_modules\\request\\lib\\cookies.js' -> 'G:\\my-react\\node_modules\\request\\lib\\cookies.js'".

I have used tons of commands nothing working

web pakistan
  • 452
  • 2
  • 14
  • Maybe this helps: https://stackoverflow.com/questions/34600932/npm-eperm-operation-not-permitted-on-windows – pintxo Aug 12 '20 at 20:17
  • Does this answer your question? [npm ERR! Error: EPERM: operation not permitted, rename](https://stackoverflow.com/questions/39293636/npm-err-error-eperm-operation-not-permitted-rename) – goto1 Aug 12 '20 at 21:50

5 Answers5

1

I had the same problem and what I did was to use this command instead so that It don't copyfile from local cache

create-react-app your_app_name --use-npm --cache /tmp/empty-cache 
0

Possible Solution :

1. Download latest recommended version of NodeJS
2. Uninstall current version from Control Panel
3. Go to C:\Users\{YourUsername}\AppData\Roaming folder and delete npm and npm-cache folders
4. Run installer of NodeJS
5. Update NPM to latest with npm i -g npm@latest command line
Saumyajit
  • 496
  • 4
  • 9
0

I changed the directory from C to another one and it worked. Maybe the issues were with installing packages in the root drive.

Orlyyn
  • 1,320
  • 1
  • 14
  • 24
0

i have some problem before so i try this and working,

if you use avast! antivirus or another antivirus, you must disable before create-react-app

-2

Do you have antivirus active on your pc? if so, try disabling it and retry the command npx create-react-app my-app

  • 2
    There's already another answer suggesting to disable the antivirus, no need to add another one. Thanks. – Eric Aya Dec 21 '20 at 10:42