I have been trying to create react app but gives this error

npm ERR! The operation was rejected by your operating system. npm ERR! It's possible that the file was already in use (by a text editor or antivirus), npm ERR! or that you lack permissions to access it. npm ERR! npm ERR! 
If you believe this might be a permissions issue, please double-check the npm ERR! permissions of the file and its containing directories, or try running npm ERR! the command again as root/Administrator. npm ERR! code EPERM npm ERR! syscall mkdir npm ERR! path C:\Users\Encrepted~Man npm ERR! errno -4048 npm ERR! Error: EPERM: operation not permitted, mkdir 'C:\Users\Encrepted~Man' npm ERR! [OperationalError: EPERM: operation not permitted, mkdir 'C:\Users\Encrepted~Man'] { npm ERR! cause: [Error: EPERM: operation not permitted, mkdir 'C:\Users\Encrepted~Man'] { npm ERR! errno: -4048, npm ERR! code: 'EPERM', npm ERR! syscall: 'mkdir', npm ERR! path: 'C:\\Users\\Encrepted~Man' npm ERR! }, npm ERR! isOperational: true, npm ERR! errno: -4048, npm ERR! code: 'EPERM', npm ERR! syscall: 'mkdir', npm ERR! path: 'C:\\Users\\Encrepted~Man' npm ERR! } npm ERR! npm ERR! The operation was rejected by your operating system. npm ERR! It's possible that the file was already in use (by a text editor or antivirus), npm ERR! or that you lack permissions to access it.
npm ERR! npm ERR! If you believe this might be a permissions issue, please double-check the npm ERR! permissions of the file and its containing directories, or try running npm ERR! the command again as root/Administrator. npm ERR! code EPERM 
npm ERR! syscall mkdir npm ERR! path C:\Users\Encrepted~Man npm ERR! errno -4048 
npm ERR! Error: EPERM: operation not permitted, mkdir 'C:\Users\Encrepted~Man' npm ERR! [OperationalError: EPERM: operation not permitted, mkdir 
'C:\Users\Encrepted~Man'] { npm ERR! cause: [Error: EPERM: operation not permitted, mkdir 'C:\Users\Encrepted~Man'] { npm ERR! errno: -4048, npm ERR! code: 'EPERM', 
npm ERR! syscall: 'mkdir', npm ERR! path: 'C:\\Users\\Encrepted~Man' npm ERR! }, 
npm ERR! isOperational: true, npm ERR! errno: -4048, npm ERR! code: 'EPERM', npm ERR! syscall: 'mkdir', npm ERR! path: 'C:\\Users\\Encrepted~Man' npm ERR! }
 npm ERR! The operation was rejected by your operating system. npm ERR! It's possible that the file was already in use (by a text editor or antivirus), npm ERR! or that you lack permissions to access it. npm ERR! 
npm ERR! If you believe this might be a permissions issue, please double-check the npm ERR! permissions of the file and its containing directories, or try running npm ERR! the command again as root/Administrator.

Welcome there,

Do you have a question? If so, please edit your post to include it.

The more information you give us, the more likely we will be able to help

Could be one of:

  • you are trying to use weird characters (~) in the name of the directory you’re trying to create, and either Windows or whatever shell you’re using to install from (git bash for example) doesn’t like it and blows up.
  • you aren’t running the terminal with admin privileges.
  • you don’t have permissions to write to that directory for some reason.
  • something other process is using files/folders you’re trying to install to so they’re locked.

Can’t tell without more info.

What type of information

What systems are you doing this on, what is the process you followed, what commands did you use, etc.

Still unlikely to be able to tell. Of the four things I said, have you checked those? Also, re the first suggestion, why are you using weird characters in the name of the folder/app you’re trying to create? Thats normally a thing that causes things to break, particularly on Windows. If you’re trying to create an app with that name, then you can’t have an NPM package with a tilde in the name so I would assume it should just blow up, it may be that rather than Windows doing it.

I was the one that personal added the character because some told it was the solution

Am using Windows that and I used npx create react app

Right, so what happens if you try running create react app with a different name that doesn’t have a tilde in it?

And are you running the terminal with admin priveliges?

And do you have permission to write to the directory you’re trying to install in (eg if you’ve encrypted it, you may not, for example)?

when i try running create react app with no tilde it still gives the same error,
am not running the terminal with admin privedlige ,
yes i have permission

Is “Encrepted Man” the Windows user profile name? If so, it might also be an issue with your profile name having a space in it. You can try moving the npm cache folder.

npm config set cache C:\nodejs\npm-cache --global

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.