+ 1

How to fix EPERM error while running create-react-app command

Web Guru@DESKTOP-EKPNDML MINGW64 ~/Documents/MERN $ npx create-react-app my-app Error: EPERM: operation not permitted, mkdir 'C:\Users\Web' 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 (<anonymous>) 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

30th Sep 2020, 1:14 PM
John Makone
John Makone - avatar
8 Respostas
+ 1
John Makone you don't need to install npx. Calviղ please read this question properly. He is already using "npx create-react-app my-app".
1st Oct 2020, 4:20 AM
🇮🇳Vivek🇮🇳
🇮🇳Vivek🇮🇳 - avatar
+ 1
If you've previously installed create-react-app globally via npm install -g create-react-app, we recommend you uninstall the package using npm uninstall -g create-react-app to ensure that npx always uses the latest version. John Makone please read the guide https://create-react-app.dev/docs/getting-started/
2nd Oct 2020, 4:27 AM
Calviղ
Calviղ - avatar
0
Are you using windows? If you are using windows use powershell instead of command prompt.
30th Sep 2020, 2:09 PM
🇮🇳Vivek🇮🇳
🇮🇳Vivek🇮🇳 - avatar
0
Yes I am let me try... thank you
30th Sep 2020, 2:12 PM
John Makone
John Makone - avatar
0
Uninstall create-react-app and use npx command instead.
1st Oct 2020, 3:18 AM
Calviղ
Calviղ - avatar
0
I haven't install npx before
1st Oct 2020, 3:26 AM
John Makone
John Makone - avatar
0
John Makone npx doesn't need to be installed, just run it from command prompt.
1st Oct 2020, 10:06 AM
Calviղ
Calviղ - avatar
0
Calviղ If you check from the error I have posted, i am running npx create-react-app my-app command. It is the npx command which is generating that error
1st Oct 2020, 10:31 AM
John Makone
John Makone - avatar