0

I have problem using npx create-react-app command
Earlier I had create-react-app installed globally on and system and used npm create-react-app command

But I learned that using npx we will always use the latest version and to use npx I have uninstalled create-react-app from my system

Whenever I try to run npx create-react-app my-app command
I get the following error:

C:\Users\Sachin Verma\Desktop\react-project>npx create-react-app tut
Error: EPERM: operation not permitted, mkdir 'C:\Users\Sachin'
command not found: create-react-app

But if I install create-react-app on my system globally, then npx command works

I tried cleaning npm cache and also reinstalled node.js but the problem still exists

Edit: When running CMD in administrator rights

Microsoft Windows [Version 10.0.19042.685]
(c) 2020 Microsoft Corporation. All rights reserved.

C:\WINDOWS\system32>cd C:\Users\Sachin Verma\Desktop\react-project\

C:\Users\Sachin Verma\Desktop\react-project>npx create-react-app tutt
npm ERR! code ENOLOCAL
npm ERR! Could not install from "Verma\AppData\Roaming\npm-cache\_npx\14832" as it does not contain a package.json file.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Sachin Verma\AppData\Roaming\npm-cache\_logs\2021-01-11T15_27_28_701Z-debug.log
Install for [ 'create-react-app@latest' ] failed with code 1

Content of log file:

0 info it worked if it ends with ok
1 verbose cli [
1 verbose cli   'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli   'C:\\Users\\Sachin Verma\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli   'install',
1 verbose cli   'create-react-app@latest',
1 verbose cli   '--global',
1 verbose cli   '--prefix',
1 verbose cli   'C:\\Users\\Sachin',
1 verbose cli   'Verma\\AppData\\Roaming\\npm-cache\\_npx\\14832',
1 verbose cli   '--loglevel',
1 verbose cli   'error',
1 verbose cli   '--json'
1 verbose cli ]
2 info using npm@6.14.11
3 info using node@v15.5.1
4 verbose npm-session 5f8e13bb496752c5
5 silly install loadCurrentTree
6 silly install readGlobalPackageData
7 silly fetchPackageMetaData error for file:Verma\AppData\Roaming\npm-cache\_npx\14832 Could not install from "Verma\AppData\Roaming\npm-cache\_npx\14832" as it does not contain a package.json file.
8 http fetch GET 304 https://registry.npmjs.org/create-react-app 2907ms (from cache)
9 silly pacote tag manifest for create-react-app@latest fetched in 2943ms
10 timing stage:rollbackFailedOptional Completed in 2ms
11 timing stage:runTopLevelLifecycles Completed in 2957ms
12 verbose stack Error: ENOENT: no such file or directory, open 'C:\Users\Sachin Verma\Desktop\react-project\Verma\AppData\Roaming\npm-cache\_npx\14832\package.json'
13 verbose cwd C:\Users\Sachin Verma\Desktop\react-project
14 verbose Windows_NT 10.0.19042
15 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\Sachin Verma\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "install" "create-react-app@latest" "--global" "--prefix" "C:\\Users\\Sachin" "Verma\\AppData\\Roaming\\npm-cache\\_npx\\14832" "--loglevel" "error" "--json"
16 verbose node v15.5.1
17 verbose npm  v6.14.11
18 error code ENOLOCAL
19 error Could not install from "Verma\AppData\Roaming\npm-cache\_npx\14832" as it does not contain a package.json file.
20 verbose exit [ 1, true ]

Is there any problem due to my username because it contains a space in between?

sachuverma
  • 559
  • 6
  • 27

1 Answers1

0

Try to run your CMD in administration or you can change your working dir, where no admin privilege is required.