Ojage S
Ojage S

Reputation: 113

The command create-react-app doesn't run, it creates an error

$ npx create-react-app awesomeApp Error: EPERM: operation not permitted, mkdir 'C:\Users\' command not found: create-react-app

Upvotes: 0

Views: 608

Answers (3)

nox
nox

Reputation: 396

I encountered EPERM errors while trying to clean install create-react-app and running an older version of it.

Excluding the node_modules folder from Windows' Virus & Threat Protection (answer found here) and then running my terminal as an administrator fixed it for me.

Upvotes: 0

Anand Chavan
Anand Chavan

Reputation: 4328

This is a bug within npm if you have your username as "FirstName LastName"

A quick fix for this is -

If your UserName is - Anand Chavan all you need to use at is ANANDC~1. i.e FirstName+First_Letter_of_your LastName+~1 (All in capital)

npm config set cache "C:\Users\<UserNameWorkAround>\AppData\Roaming\npm-cache" --global

Example config for - Anand Chavan as username.

npm config set cache "C:\Users\ANANDC~1\AppData\Roaming\npm-cache" --global

Upvotes: 1

Alvin Ong
Alvin Ong

Reputation: 1

I faced the same issue as well in Windows. And I solved it as below:

It may be due to your username having space in between your username. If so, kindly try this in your command prompt if you're using Windows: npm config set cache "C:\Users\Your Name\AppData\Roaming\npm-cache" --global

Thereafter, try again: npx create-react-app awesome

Upvotes: 0

Related Questions