Closed vaidehishah07 closed 3 years ago
Open your IDE's terminal and type this :
npm install -g create-react-app
Followed by:
npx create-react-app <Any name that you want>
Cheers,
Try installing it globally first, using the command
npm install -g create-react-app
And then, you can create your app using the command,
npx create-react-app <Name of your app>
Hope this helps :)
Thank you so much!!!
@Sahithi-Venkatesan thank you very much for quick advice!
Try installing it globally first, using the command
npm install -g create-react-app
And then, you can create your app using the command,
npx create-react-app <Name of your app>
Hope this helps :)
This has helped me...many thanks
This error is caused by having a space in your User name (i.e the name of your machine) for instance my machine name is Themba Alex, npx has an issue when such is the case, the solution to this is to open your terminal and run this command: npm config edit afterward go to every line that is starting with ;cache=C:\Users\Themba Alex\AppData\Roaming\npm-cache, remove the ; and remove the space on your username, write the first 6 letters and add
"~1"
i.e;cache=C:\Users\Themba Alex\AppData\Roaming\npm-cache
will now becache=C:\Users\Themba~1\AppData\Roaming\npm-cache
this will solve the issueAfter a lot of digging and coming to this, I thought this would solve my problem but it isn't solving my problem. Even after changing
Firstname Lastname
toFirstname~1
and toFirstname~Lastname
I am getting the same error.Error: EPERM: operation not permitted, mkdir 'C:\Users\Firstname~Lastname' command not found: create-react-app
I found the solution to this. Instead of just changing
Firstname Lastname
toFirstname~1
orFirstname~Lastname
, check what the short name for your Username directory is. You can do this by opening the CMD as an administrator and runningdir /x
in the parent folder of the folder whose short name you're trying to find. In this case since you want to know the short name to yourFirstname Lastname
folder, the parent folder will beC:/Users
. So go toC:/Users
and rundir /x
. You'll find the short name of yourFirstname Lastname
folder. It may not necessarily beFirstname~1
. In my case, it wasFirstnameL~1
. After this you can runnpm config set cache "C:/Users/<shortname-you-found-with-dir/x>/AppData/Roaming/npm-cache" --global
. Now you should be able to runnpx create-react-app my-app
without any issue.
You are Maseiah!!
This error is caused by having a space in your User name (i.e the name of your machine) for instance my machine name is Themba Alex, npx has an issue when such is the case, the solution to this is to open your terminal and run this command: npm config edit afterward go to every line that is starting with ;cache=C:\Users\Themba Alex\AppData\Roaming\npm-cache, remove the ; and remove the space on your username, write the first 6 letters and add
"~1"
i.e;cache=C:\Users\Themba Alex\AppData\Roaming\npm-cache
will now becache=C:\Users\Themba~1\AppData\Roaming\npm-cache
this will solve the issueAfter a lot of digging and coming to this, I thought this would solve my problem but it isn't solving my problem. Even after changing
Firstname Lastname
toFirstname~1
and toFirstname~Lastname
I am getting the same error.Error: EPERM: operation not permitted, mkdir 'C:\Users\Firstname~Lastname' command not found: create-react-app
I found the solution to this. Instead of just changing
Firstname Lastname
toFirstname~1
orFirstname~Lastname
, check what the short name for your Username directory is. You can do this by opening the CMD as an administrator and runningdir /x
in the parent folder of the folder whose short name you're trying to find. In this case since you want to know the short name to yourFirstname Lastname
folder, the parent folder will beC:/Users
. So go toC:/Users
and rundir /x
. You'll find the short name of yourFirstname Lastname
folder. It may not necessarily beFirstname~1
. In my case, it wasFirstnameL~1
. After this you can runnpm config set cache "C:/Users/<shortname-you-found-with-dir/x>/AppData/Roaming/npm-cache" --global
. Now you should be able to runnpx create-react-app my-app
without any issue.
I tried this and its still showing the same error please I need your help
Try installing it globally first, using the command
npm install -g create-react-app
And then, you can create your app using the command,
npx create-react-app <Name of your app>
Hope this helps :)
First of all, it is not a recommended solution which you can see from the official docs
Note my username for my machine is Assad Ullah Chaudhry
You got spaces in your username that's why it is not working for you
Follow the steps to make it work:
C:\Users
C:\Users
, type dir /x
and you should see something like this.
npm config set cache "C:/Users/<your-shortname-goes-here>/AppData/Roaming/npm-cache" --global
. With my short name, this command looks like this npm config set cache "C:/Users/ASSADU~1/AppData/Roaming/npm-cache" --global
just so you know the final look of it before running it.npx create-react-app my-app
and that's it. Hope it helps!
This error is caused by having a space in your User name (i.e the name of your machine) for instance my machine name is Themba Alex, npx has an issue when such is the case, the solution to this is to open your terminal and run this command: npm config edit afterward go to every line that is starting with ;cache=C:\Users\Themba Alex\AppData\Roaming\npm-cache, remove the ; and remove the space on your username, write the first 6 letters and add
"~1"
i.e;cache=C:\Users\Themba Alex\AppData\Roaming\npm-cache
will now becache=C:\Users\Themba~1\AppData\Roaming\npm-cache
this will solve the issueAfter a lot of digging and coming to this, I thought this would solve my problem but it isn't solving my problem. Even after changing
Firstname Lastname
toFirstname~1
and toFirstname~Lastname
I am getting the same error.Error: EPERM: operation not permitted, mkdir 'C:\Users\Firstname~Lastname' command not found: create-react-app
I found the solution to this. Instead of just changing
Firstname Lastname
toFirstname~1
orFirstname~Lastname
, check what the short name for your Username directory is. You can do this by opening the CMD as an administrator and runningdir /x
in the parent folder of the folder whose short name you're trying to find. In this case since you want to know the short name to yourFirstname Lastname
folder, the parent folder will beC:/Users
. So go toC:/Users
and rundir /x
. You'll find the short name of yourFirstname Lastname
folder. It may not necessarily beFirstname~1
. In my case, it wasFirstnameL~1
. After this you can runnpm config set cache "C:/Users/<shortname-you-found-with-dir/x>/AppData/Roaming/npm-cache" --global
. Now you should be able to runnpx create-react-app my-app
without any issue.I tried this and its still showing the same error please I need your help
check my reply to make it work for you. Solution to make it work
This error is caused by having a space in your User name (i.e the name of your machine) for instance my machine name is Themba Alex, npx has an issue when such is the case, the solution to this is to open your terminal and run this command: npm config edit afterward go to every line that is starting with ;cache=C:\Users\Themba Alex\AppData\Roaming\npm-cache, remove the ; and remove the space on your username, write the first 6 letters and add
"~1"
i.e;cache=C:\Users\Themba Alex\AppData\Roaming\npm-cache
will now becache=C:\Users\Themba~1\AppData\Roaming\npm-cache
this will solve the issue
This one worked for me.
First go to C:/Users and get your truncated username from there and in cmd (admin level permission), do these
npm config edit afterward go to every line that is starting with ;cache=C:\Users\Themba Alex\AppData\Roaming\npm-cache, remove the ; and remove the space on your username, write the first 6 letters and add
"~1"
i.e;cache=C:\Users\Themba Alex\AppData\Roaming\npm-cache
will now becache=C:\Users\Themba~1\AppData\Roaming\npm-cache
this will solve the issue
Try installing it globally first, using the command
npm install -g create-react-app
And then, you can create your app using the command,
npx create-react-app <Name of your app>
Hope this helps :)
Error fixed. Thank you.
Try installing it globally first, using the command
npm install -g create-react-app
And then, you can create your app using the command,
npx create-react-app <Name of your app>
Hope this helps :)
Thank you it's working .
This error is caused by having a space in your User name (i.e the name of your machine) for instance my machine name is Themba Alex, npx has an issue when such is the case, the solution to this is to open your terminal and run this command: npm config edit afterward go to every line that is starting with ;cache=C:\Users\Themba Alex\AppData\Roaming\npm-cache, remove the ; and remove the space on your username, write the first 6 letters and add
"~1"
i.e;cache=C:\Users\Themba Alex\AppData\Roaming\npm-cache
will now becache=C:\Users\Themba~1\AppData\Roaming\npm-cache
this will solve the issueAfter a lot of digging and coming to this, I thought this would solve my problem but it isn't solving my problem. Even after changing
Firstname Lastname
toFirstname~1
and toFirstname~Lastname
I am getting the same error.Error: EPERM: operation not permitted, mkdir 'C:\Users\Firstname~Lastname' command not found: create-react-app
I found the solution to this. Instead of just changing
Firstname Lastname
toFirstname~1
orFirstname~Lastname
, check what the short name for your Username directory is. You can do this by opening the CMD as an administrator and runningdir /x
in the parent folder of the folder whose short name you're trying to find. In this case since you want to know the short name to yourFirstname Lastname
folder, the parent folder will beC:/Users
. So go toC:/Users
and rundir /x
. You'll find the short name of yourFirstname Lastname
folder. It may not necessarily beFirstname~1
. In my case, it wasFirstnameL~1
. After this you can runnpm config set cache "C:/Users/<shortname-you-found-with-dir/x>/AppData/Roaming/npm-cache" --global
. Now you should be able to runnpx create-react-app my-app
without any issue.Thanks. This resolved the issue.
Worked Thanks
Thank you so much, It works
a
you rock
solve the error write the command in the terminal: npm uninstall -g create-react-app && npm i -g npm@latest && npm cache clean -f Now create your react app by command: create-react-app my-app
Try installing it globally first, using the command
npm install -g create-react-app
And then, you can create your app using the command,
npx create-react-app <Name of your app>
Hope this helps :)
thanks! it worked :)
This error is caused by having a space in your User name (i.e the name of your machine) for instance my machine name is Themba Alex, npx has an issue when such is the case, the solution to this is to open your terminal and run this command: npm config edit afterward go to every line that is starting with ;cache=C:\Users\Themba Alex\AppData\Roaming\npm-cache, remove the ; and remove the space on your username, write the first 6 letters and add
"~1"
i.e;cache=C:\Users\Themba Alex\AppData\Roaming\npm-cache
will now becache=C:\Users\Themba~1\AppData\Roaming\npm-cache
this will solve the issueAfter a lot of digging and coming to this, I thought this would solve my problem but it isn't solving my problem. Even after changing
Firstname Lastname
toFirstname~1
and toFirstname~Lastname
I am getting the same error.Error: EPERM: operation not permitted, mkdir 'C:\Users\Firstname~Lastname' command not found: create-react-app
I found the solution to this. Instead of just changing
Firstname Lastname
toFirstname~1
orFirstname~Lastname
, check what the short name for your Username directory is. You can do this by opening the CMD as an administrator and runningdir /x
in the parent folder of the folder whose short name you're trying to find. In this case since you want to know the short name to yourFirstname Lastname
folder, the parent folder will beC:/Users
. So go toC:/Users
and rundir /x
. You'll find the short name of yourFirstname Lastname
folder. It may not necessarily beFirstname~1
. In my case, it wasFirstnameL~1
. After this you can runnpm config set cache "C:/Users/<shortname-you-found-with-dir/x>/AppData/Roaming/npm-cache" --global
. Now you should be able to runnpx create-react-app my-app
without any issue.
It worked for me!
It worked for me at first attempt
Try installing it globally first, using the command
And then, you can create your app using the command,
Intente instalarlo globalmente primero, usando el comando
npm install -g create-react-app
Y luego, puede crear su aplicación usando el comando,
npx create-react-app <Name of your app>
Espero que esto ayude :)
Excelente solución... 2021 funcionando,. mil gracias.
Try installing it globally first, using the command
npm install -g create-react-app
And then, you can create your app using the command,
npx create-react-app <Name of your app>
Hope this helps :)
This help me tooo
Try installing it globally first, using the command
npm install -g create-react-app
And then, you can create your app using the command,
npx create-react-app <Name of your app>
Hope this helps :)
This is perfect .. Thank you so much
Try installing it globally first, using the command
npm install -g create-react-app
And then, you can create your app using the command,
npx create-react-app <Name of your app>
Hope this helps :)
Thank You
Try installing it globally first, using the command npm install -g create-react-app
And then, you can create your app using the command,
npx create-react-app
Nothing here solved my issue. Am frustrated right now thou.
Nothing here solved my issue. Am frustrated right now thou.
@Akintola-Stephen Don't worry. Let me help you out with this :)
Note my username for my machine is Assad Ullah Chaudhry
You got spaces in your username that's why it is not working for you
Follow the steps to make it work:
C:\Users
C:\Users
, type dir /x
and you should see something like this.
npm config set cache "C:/Users/<your-shortname-goes-here>/AppData/Roaming/npm-cache" --global
. With my short name, this command looks like this npm config set cache "C:/Users/ASSADU~1/AppData/Roaming/npm-cache" --global
just so you know the final look of it before running it.npx create-react-app my-app
and that's it. Hope it helps!
This error is caused by having a space in your User name (i.e the name of your machine) for instance my machine name is Themba Alex, npx has an issue when such is the case, the solution to this is to open your terminal and run this command: npm config edit afterward go to every line that is starting with ;cache=C:\Users\Themba Alex\AppData\Roaming\npm-cache, remove the ; and remove the space on your username, write the first 6 letters and add
"~1"
i.e;cache=C:\Users\Themba Alex\AppData\Roaming\npm-cache
will now becache=C:\Users\Themba~1\AppData\Roaming\npm-cache
this will solve the issue
you saved me, thanks
I was facing the same problem for 3 days and got this solution for it...
It's because of old files lying in your c drive:
Follow the steps below and try, It will work for sure.
problem:
npm ERR! Errno: -4048, npm ERR! code: ‘EPERM’, npm ERR! syscall: ‘scandir’,
solution:
Uninstall node with node uninstaller ( find it from run cmd )
Then...
Delete the npmrc file and delete the C:\Users\Administrator.npmrc file ( if don't find leave it )
Delete npm-cache folder from - C:\Users\Administrator\AppData\Roaming
Delete npm folder from - C:\Users\Administrator\AppData\Roaming
Restart your system and install fresh NodeJS and run this command in cmd: npm cache clean -–force to ensure the cache is cleared.
That's your ready to go now...
If you still face a problem feel free to get in touch with me @ishaiknadeem username on any platform
such
thanks man, it's very helpful
Try installing it globally first, using the command
npm install -g create-react-app
And then, you can create your app using the command,
npx create-react-app <Name of your app>
Hope this helps :)
It is working !! Thanks!
I got the same ERROR..!
I solve it,
1.Try install npm globally first,
npm install -g create-react-app
npx create-react-app <Name of the project>
Try installing it globally first, using the command
npm install -g create-react-app
And then, you can create your app using the command,
npx create-react-app <Name of your app>
Hope this helps :)
Thanks..
thank you for this
Try installing it globally first, using the command
npm install -g create-react-app
And then, you can create your app using the command,npx create-react-app <Name of your app>
Hope this helps :)First of all, it is not a recommended solution which you can see from the official docs
I'm on Windows 10 64-bit Pro and let me explain how I made it work step by step.
Note my username for my machine is Assad Ullah Chaudhry
You got spaces in your username that's why it is not working for you
Follow the steps to make it work:
- Open up power shell or any command line program go into
C:\Users
- Once you are in
C:\Users
, typedir /x
and you should see something like this.- You can see my short name is ASSADU~1 and in your case it would be different. Now run this command
npm config set cache "C:/Users/<your-shortname-goes-here>/AppData/Roaming/npm-cache" --global
. With my short name, this command looks like thisnpm config set cache "C:/Users/ASSADU~1/AppData/Roaming/npm-cache" --global
just so you know the final look of it before running it.- Final step, run
npx create-react-app my-app
and that's it.Hope it helps!
Thanks Man 🥲🥲🥲 It helped
This error is caused by having a space in your User name (i.e the name of your machine) for instance my machine name is Themba Alex, npx has an issue when such is the case, the solution to this is to open your terminal and run this command: npm config edit afterward go to every line that is starting with ;cache=C:\Users\Themba Alex\AppData\Roaming\npm-cache, remove the ; and remove the space on your username, write the first 6 letters and add
"~1"
i.e;cache=C:\Users\Themba Alex\AppData\Roaming\npm-cache
will now becache=C:\Users\Themba~1\AppData\Roaming\npm-cache
this will solve the issue
thank you I resolved my issue with this
Thanks for solution for beginners in react help a lot.
Try installing it globally first, using the command
npm install -g create-react-app
t. And then, you can create your app using the command,npx create-react-app <Name of your app>
Hope this helps :)
Thanks a lot it working . And it will help to beginner in react.
This error is caused by having a space in your User name (i.e the name of your machine) for instance my machine name is Themba Alex, npx has an issue when such is the case, the solution to this is to open your terminal and run this command: npm config edit afterward go to every line that is starting with ;cache=C:\Users\Themba Alex\AppData\Roaming\npm-cache, remove the ; and remove the space on your username, write the first 6 letters and add
"~1"
i.e;cache=C:\Users\Themba Alex\AppData\Roaming\npm-cache
will now becache=C:\Users\Themba~1\AppData\Roaming\npm-cache
this will solve the issue
This is the most appropriate solution for me. Thanks for sharing!
This error is caused by having a space in your User name (i.e the name of your machine) for instance my machine name is Themba Alex, npx has an issue when such is the case, the solution to this is to open your terminal and run this command: npm config edit afterward go to every line that is starting with ;cache=C:\Users\Themba Alex\AppData\Roaming\npm-cache, remove the ; and remove the space on your username, write the first 6 letters and add
"~1"
i.e;cache=C:\Users\Themba Alex\AppData\Roaming\npm-cache
will now becache=C:\Users\Themba~1\AppData\Roaming\npm-cache
this will solve the issueAfter a lot of digging and coming to this, I thought this would solve my problem but it isn't solving my problem. Even after changing
Firstname Lastname
toFirstname~1
and toFirstname~Lastname
I am getting the same error.Error: EPERM: operation not permitted, mkdir 'C:\Users\Firstname~Lastname' command not found: create-react-app
I found the solution to this. Instead of just changing
Firstname Lastname
toFirstname~1
orFirstname~Lastname
, check what the short name for your Username directory is. You can do this by opening the CMD as an administrator and runningdir /x
in the parent folder of the folder whose short name you're trying to find. In this case since you want to know the short name to yourFirstname Lastname
folder, the parent folder will beC:/Users
. So go toC:/Users
and rundir /x
. You'll find the short name of yourFirstname Lastname
folder. It may not necessarily beFirstname~1
. In my case, it wasFirstnameL~1
. After this you can runnpm config set cache "C:/Users/<shortname-you-found-with-dir/x>/AppData/Roaming/npm-cache" --global
. Now you should be able to runnpx create-react-app my-app
without any issue.
SAVIOUR.
Im trying to create a react app using command create-react-app and getting the error of,
MY COMMAND: (using . as i want to create the app in the current folder itself)
C:\Users\Vaidehi Shah\Desktop\MERN-ShoppingList\client> npx create-react-app .
ERROR MESSAGE:
Error: EPERM: operation not permitted, mkdir 'C:\Users\Vaidehi' TypeError: Cannot read property 'get' of undefined at errorMessage (C:\Program Files\nodejs\node_modules\npm\lib\utils\error-message.js:38:39) at errorHandler (C:\Program Files\nodejs\node_modules\npm\lib\utils\error-handler.js:201:13) at C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js:78:20 at cb (C:\Program Files\nodejs\node_modules\npm\lib\npm.js:225:22) at C:\Program Files\nodejs\node_modules\npm\lib\npm.js:263:24 at C:\Program Files\nodejs\node_modules\npm\lib\config\core.js:81:7 at Array.forEach () at C:\Program Files\nodejs\node_modules\npm\lib\config\core.js:80:13 at f (C:\Program Files\nodejs\node_modules\npm\node_modules\once\once.js:25:25) at afterExtras (C:\Program Files\nodejs\node_modules\npm\lib\config\core.js:171:20) C:\Program Files\nodejs\node_modules\npm\lib\utils\error-handler.js:97 var doExit = npm.config.loaded ? npm.config.get('_exit') : true ^
TypeError: Cannot read property 'loaded' of undefined at exit (C:\Program Files\nodejs\node_modules\npm\lib\utils\error-handler.js:97:27) at process.errorHandler (C:\Program Files\nodejs\node_modules\npm\lib\utils\error-handler.js:216:3) at process.emit (events.js:210:5) at process._fatalException (internal/process/execution.js:150:25) Install for [ 'create-react-app@latest' ] failed with code 7
firstly install globally -> npm install -g create-react-app and then type -> npx create-react-app
Nothing here solved my issue. Am frustrated right now thou.
@Akintola-Stephen Don't worry. Let me help you out with this :)
I'm on Windows 10 64-bit Pro and let me explain how I made it work step by step.
Note my username for my machine is Assad Ullah Chaudhry
You got spaces in your username that's why it is not working for you
Follow the steps to make it work:
- Open up power shell or any command-line program go into
C:\Users
- Once you are in
C:\Users
, typedir /x
and you should see something like this.- You can see my short name is ASSADU~1 and in your case it would be different. Now run this command
npm config set cache "C:/Users/<your-shortname-goes-here>/AppData/Roaming/npm-cache" --global
. With my short name, this command looks like thisnpm config set cache "C:/Users/ASSADU~1/AppData/Roaming/npm-cache" --global
just so you know the final look of it before running it.- Final step, run
npx create-react-app my-app
and that's it.Hope it helps!
That worked for me. Thank you for the input.
Try installing it globally first, using the command
npm install -g create-react-app
And then, you can create your app using the command,
npx create-react-app <Name of your app>
Hope this helps :)
Yes! This worked. Thanks a ton
Nothing here solved my issue. Am frustrated right now thou.
@Akintola-Stephen Don't worry. Let me help you out with this :)
I'm on Windows 10 64-bit Pro and let me explain how I made it work step by step.
Note my username for my machine is Assad Ullah Chaudhry
You got spaces in your username that's why it is not working for you
Follow the steps to make it work:
- Open up power shell or any command-line program go into
C:\Users
- Once you are in
C:\Users
, typedir /x
and you should see something like this.- You can see my short name is ASSADU~1 and in your case it would be different. Now run this command
npm config set cache "C:/Users/<your-shortname-goes-here>/AppData/Roaming/npm-cache" --global
. With my short name, this command looks like thisnpm config set cache "C:/Users/ASSADU~1/AppData/Roaming/npm-cache" --global
just so you know the final look of it before running it.- Final step, run
npx create-react-app my-app
and that's it.Hope it helps!
dir /x
command not work on power shell, use cmdNothing here solved my issue. Am frustrated right now thou.
@Akintola-Stephen Don't worry. Let me help you out with this :)
I'm on Windows 10 64-bit Pro and let me explain how I made it work step by step.
Note my username for my machine is Assad Ullah Chaudhry You got spaces in your username that's why it is not working for you Follow the steps to make it work:
- Open up power shell or any command-line program go into
C:\Users
- Once you are in
C:\Users
, typedir /x
and you should see something like this.- You can see my short name is ASSADU~1 and in your case it would be different. Now run this command
npm config set cache "C:/Users/<your-shortname-goes-here>/AppData/Roaming/npm-cache" --global
. With my short name, this command looks like thisnpm config set cache "C:/Users/ASSADU~1/AppData/Roaming/npm-cache" --global
just so you know the final look of it before running it.- Final step, run
npx create-react-app my-app
and that's it.Hope it helps!
On power shell not work, use cmd
@Angel-Ponce make sure to close and reopen your powershell. It's a solid workaround.
Nothing here solved my issue. Am frustrated right now thou.
@Akintola-Stephen Don't worry. Let me help you out with this :)
I'm on Windows 10 64-bit Pro and let me explain how I made it work step by step.
Note my username for my machine is Assad Ullah Chaudhry You got spaces in your username that's why it is not working for you Follow the steps to make it work:
- Open up power shell or any command-line program go into
C:\Users
- Once you are in
C:\Users
, typedir /x
and you should see something like this.- You can see my short name is ASSADU~1 and in your case it would be different. Now run this command
npm config set cache "C:/Users/<your-shortname-goes-here>/AppData/Roaming/npm-cache" --global
. With my short name, this command looks like thisnpm config set cache "C:/Users/ASSADU~1/AppData/Roaming/npm-cache" --global
just so you know the final look of it before running it.- Final step, run
npx create-react-app my-app
and that's it.Hope it helps!
On power shell not work, use cmd
@Angel-Ponce make sure to close and reopen your powershell. It's a solid workaround.
Excuse me, my bad, I just update my comment.
Try installing it globally first, using the command npm install -g create-react-app
And then, you can create your app using the command, npx create-react-app Thanks a lot, it works. And it will help to a beginner in react.
Thanks a lot for the help.
Try installing it globally first, using the command
npm install -g create-react-app
And then, you can create your app using the command,
npx create-react-app <Name of your app>
Hope this helps :)
Thank you very much!
This error is caused by having a space in your User name (i.e the name of your machine) for instance my machine name is Themba Alex, npx has an issue when such is the case, the solution to this is to open your terminal and run this command: npm config edit afterward go to every line that is starting with ;cache=C:\Users\Themba Alex\AppData\Roaming\npm-cache, remove the ; and remove the space on your username, write the first 6 letters and add
"~1"
i.e;cache=C:\Users\Themba Alex\AppData\Roaming\npm-cache
will now becache=C:\Users\Themba~1\AppData\Roaming\npm-cache
this will solve the issueAfter a lot of digging and coming to this, I thought this would solve my problem but it isn't solving my problem. Even after changing
Firstname Lastname
toFirstname~1
and toFirstname~Lastname
I am getting the same error.Error: EPERM: operation not permitted, mkdir 'C:\Users\Firstname~Lastname' command not found: create-react-app
I found the solution to this. Instead of just changing
Firstname Lastname
toFirstname~1
orFirstname~Lastname
, check what the short name for your Username directory is. You can do this by opening the CMD as an administrator and runningdir /x
in the parent folder of the folder whose short name you're trying to find. In this case since you want to know the short name to yourFirstname Lastname
folder, the parent folder will beC:/Users
. So go toC:/Users
and rundir /x
. You'll find the short name of yourFirstname Lastname
folder. It may not necessarily beFirstname~1
. In my case, it wasFirstnameL~1
. After this you can runnpm config set cache "C:/Users/<shortname-you-found-with-dir/x>/AppData/Roaming/npm-cache" --global
. Now you should be able to runnpx create-react-app my-app
without any issue.
bro can u help me in a google meet ,am stuck with this problem since months!! Please bro , it will b very kind of you, if you want i can pay u also!!
Nothing here solved my issue. Am frustrated right now thou.
@Akintola-Stephen Don't worry. Let me help you out with this :)
I'm on Windows 10 64-bit Pro and let me explain how I made it work step by step.
Note my username for my machine is Assad Ullah Chaudhry You got spaces in your username that's why it is not working for you Follow the steps to make it work:
- Open up power shell or any command-line program go into
C:\Users
- Once you are in
C:\Users
, typedir /x
and you should see something like this.- You can see my short name is ASSADU~1 and in your case it would be different. Now run this command
npm config set cache "C:/Users/<your-shortname-goes-here>/AppData/Roaming/npm-cache" --global
. With my short name, this command looks like thisnpm config set cache "C:/Users/ASSADU~1/AppData/Roaming/npm-cache" --global
just so you know the final look of it before running it.- Final step, run
npx create-react-app my-app
and that's it.Hope it helps!
On power shell not work, use cmd
@Angel-Ponce make sure to close and reopen your powershell. It's a solid workaround.
Excuse me, my bad, I just update my comment.
bro can u help me in a google meet ,am stuck with this problem since months!! Please bro , it will b very kind of you, if you want i can pay u also!!
I was facing the same problem for 3 days and got this solution for it...
It's because of old files lying in your c drive:
Follow the steps below and try, It will work for sure.
problem:
npm ERR! Errno: -4048, npm ERR! code: ‘EPERM’, npm ERR! syscall: ‘scandir’,
solution:
Uninstall node with node uninstaller ( find it from run cmd )
Then...
Delete the npmrc file and delete the C:\Users\Administrator.npmrc file ( if don't find leave it )
Delete npm-cache folder from - C:\Users\Administrator\AppData\Roaming
Delete npm folder from - C:\Users\Administrator\AppData\Roaming
Restart your system and install fresh NodeJS and run this command in cmd: npm cache clean -–force to ensure the cache is cleared.
That's your ready to go now...
If you still face a problem feel free to get in touch with me @ishaiknadeem username on any platform
bro can u help me in google meet , i have been stuck with this problem since months, tried different solutions none worked!! please bhai ,i can pay u !! it will b very kind if u help!
Nothing here solved my issue. Am frustrated right now thou.
@Akintola-Stephen Don't worry. Let me help you out with this :)
I'm on Windows 10 64-bit Pro and let me explain how I made it work step by step.
Note my username for my machine is Assad Ullah Chaudhry
You got spaces in your username that's why it is not working for you
Follow the steps to make it work:
- Open up power shell or any command-line program go into
C:\Users
- Once you are in
C:\Users
, typedir /x
and you should see something like this.- You can see my short name is ASSADU~1 and in your case it would be different. Now run this command
npm config set cache "C:/Users/<your-shortname-goes-here>/AppData/Roaming/npm-cache" --global
. With my short name, this command looks like thisnpm config set cache "C:/Users/ASSADU~1/AppData/Roaming/npm-cache" --global
just so you know the final look of it before running it.- Final step, run
npx create-react-app my-app
and that's it.Hope it helps!
i cant found my shortname while dir /x. showing long name only.
Im trying to create a react app using command create-react-app and getting the error of,
MY COMMAND: (using . as i want to create the app in the current folder itself)
C:\Users\Vaidehi Shah\Desktop\MERN-ShoppingList\client> npx create-react-app .
ERROR MESSAGE:
Error: EPERM: operation not permitted, mkdir 'C:\Users\Vaidehi' TypeError: Cannot read property 'get' of undefined at errorMessage (C:\Program Files\nodejs\node_modules\npm\lib\utils\error-message.js:38:39) at errorHandler (C:\Program Files\nodejs\node_modules\npm\lib\utils\error-handler.js:201:13) at C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js:78:20 at cb (C:\Program Files\nodejs\node_modules\npm\lib\npm.js:225:22) at C:\Program Files\nodejs\node_modules\npm\lib\npm.js:263:24 at C:\Program Files\nodejs\node_modules\npm\lib\config\core.js:81:7 at Array.forEach ()
at C:\Program Files\nodejs\node_modules\npm\lib\config\core.js:80:13
at f (C:\Program Files\nodejs\node_modules\npm\node_modules\once\once.js:25:25)
at afterExtras (C:\Program Files\nodejs\node_modules\npm\lib\config\core.js:171:20)
C:\Program Files\nodejs\node_modules\npm\lib\utils\error-handler.js:97
var doExit = npm.config.loaded ? npm.config.get('_exit') : true
^
TypeError: Cannot read property 'loaded' of undefined at exit (C:\Program Files\nodejs\node_modules\npm\lib\utils\error-handler.js:97:27) at process.errorHandler (C:\Program Files\nodejs\node_modules\npm\lib\utils\error-handler.js:216:3) at process.emit (events.js:210:5) at process._fatalException (internal/process/execution.js:150:25) Install for [ 'create-react-app@latest' ] failed with code 7