Skip to main content

Creating React App

While I was creating my first react app, I faced the following problem...

Error: EPERM: operation not permitted, mkdir 'C:\Users\Vighnesh'

Actually, in my current laptop, my username has a space in between "Vighnesh Bendre". Hence, when I run following command, I get the error.

C:\Users\Vighnesh Bendre\github-finder>npx create-react-app .

The best solution I found was here. It goes like this...

Step 1. Run "npm config edit". This will open a notepad with commented text,
2. Find "cache". Mine looked like this...
      ; cache=C:\Users\Vighnesh Bendre\AppData\Roaming\npm-cache
3. Change it to remove the space & shorter version of folder name.
      cache=C:\Users\VIGHNE~1\AppData\Roaming\npm-cache
4. If you want to know the shorter version of the folder name, then use "dir /x" in cmd prompt.
5. And dont forget to remove the ';',
6. Once you save & close this file, then run "npx create-react-app ."again.

Hope this helps someone...


Comments