简体   繁体   中英

Error: EEXIST: file already exists, mkdir C:\users\computer-name in React

I'm trying to create react project, for that I installed node and npm following this this link.

Now when I run the following command

npx create-react-app my-app

It gives me

Error: EEXIST: file already exists, mkdir 'C:\Users\Mehmood' TypeError: Cannot read property 'loaded' of undefined at exit (C:\Program Files\nodejs\node\node_modules\npm\lib\utils\error-handler.js:98:27) at errorHandler (C:\Program Files\nodejs\node\node_modules\npm\lib\utils\error-handler.js:216:3) at C:\Program Files\nodejs\node\node_modules\npm\bin\npm-cli.js:77:20 at cb (C:\Program Files\nodejs\node\node_modules\npm\lib\npm.js:225:22) at C:\Program Files\nodejs\node\node_modules\npm\lib\npm.js:263:24 at C:\Program Files\nodejs\node\node_modules\npm\lib\config\core.js:83:7 at Array.forEach () at C:\Program Files\nodejs\node\node_modules\npm\lib\config\core.js:82:13 at f (C:\Program Files\nodejs\node\node_modules\npm\node_modules\once\once.js:25:25) at afterExtras (C:\Program Files\nodejs\node\node_modules\npm\lib\config\core.js:173:20) Z0D61F8370CAD1D41 2F80B84D143E1257Z:\Program Files\nodejs\node\node_modules\npm\lib\utils\error-handler.js:98 var doExit = npm.config.loaded? npm.config.get('_exit'): true ^

TypeError: Cannot read property 'loaded' of undefined at exit (C:\Program Files\nodejs\node\node_modules\npm\lib\utils\error-handler.js:98:27) at process.errorHandler (C:\Program Files\nodejs\node\node_modules\npm\lib\utils\error-handler.js:216:3) at process.emit (events.js:198:13) at process._fatalException (internal/bootstrap/node.js:496:27) Install for create-react-app@latest failed with code 7

I have gone through this and this

I uninstalled the old node , deleted all the files, and installed new node , and then tried to create react project but still I'm facing the same issue .

Note: Few days ago, I made some changes to my environment variables , I don't know will that effect some settings ?

Please leave your precious comments.

Thank you.

I npm uninstall -g create-react-app then installed it again and it worked for me!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM