简体   繁体   English

无法使用 create-react-app 设置反应

[英]unable to setup react using create-react-app

I have started working on react and to practice I have installed Node 12 which installed npm automatically than I created a folder " reacthello " and than typed "npm -i" than "npm i -g create-react-app" but its throwing the following error again and again even I tried with npx also.我已经开始研究 react 并练习我已经安装了Node 12 ,它自动安装了npm ,然后我创建了一个文件夹“ reacthello ”,然后输入"npm -i"不是"npm i -g create-react-app"但是它抛出了即使我尝试使用npx也一次又一次地跟随错误。 By the way I have cleared the cache by force as well "npm cache clean --force" but this error is not going away.顺便说一下,我已经强制清除了缓存以及"npm cache clean --force"但这个错误并没有消失。 Anyone can help me here I would be grateful and guide me the right direction.任何人都可以在这里帮助我,我将不胜感激并指导我正确的方向。

E:\reactjsapps>npx create-react-app myapp-01
[############......] | finalize:jsonfile: sill finalize C:\Users\user.id\AppData\Roaming\npm-cache\_npx\10908\node_modules\create-react-app\node_modules\jsonfile[############......] | finalize:jsonfile: sill finalize C:\Users\user.id\Apnpm ERR! code ENOENT
npm ERR! syscall rename
npm ERR! path C:\Users\user.id\AppData\Roaming\npm-cache\_npx\10908\node_modules\create-react-app\node_modules\lodash
npm ERR! dest C:\Users\user.id\AppData\Roaming\npm-cache\_npx\10908\node_modules\create-react-app\node_modules\.lodash.DELETE
npm ERR! errno -4058
npm ERR! enoent ENOENT: no such file or directory, rename 'C:\Users\user.id\AppData\Roaming\npm-cache\_npx\10908\node_modules\create-react-app\node_modules\lodash' -> 'C:\Users\user.id\AppData\Roaming\npm-cache\_npx\10908\node_modules\create-react-app\node_modules\.lodash.DELETE'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\user.id\AppData\Roaming\npm-cache\_logs\2020-01-15T07_48_30_687Z-debug.log
Install for [ 'create-react-app@latest' ] failed with code 4294963238
D:\Program Files\nodejs\node_modules\npm\node_modules\rimraf\rimraf.js:313
        throw er
        ^

Error: ENOTEMPTY: directory not empty, rmdir 'C:\Users\user.id\AppData\Roaming\npm-cache\_npx\10908'
[90m    at Object.rmdirSync (fs.js:752:3)[39m
    at rmkidsSync (D:\Program Files\nodejs\node_modules\[4mnpm[24m\node_modules\[4mrimraf[24m\rimraf.js:356:25)
    at rmdirSync (D:\Program Files\nodejs\node_modules\[4mnpm[24m\node_modules\[4mrimraf[24m\rimraf.js:334:7)
    at Function.rimrafSync [as sync] (D:\Program Files\nodejs\node_modules\[4mnpm[24m\node_modules\[4mrimraf[24m\rimraf.js:304:9)
    at process.<anonymous> (D:\Program Files\nodejs\node_modules\[4mnpm[24m\node_modules\[4mlibnpx[24m\index.js:151:37)
[90m    at process.emit (events.js:223:5)[39m {
  errno: [33m-4051[39m,
  syscall: [32m'rmdir'[39m,
  code: [32m'ENOTEMPTY'[39m,
  path: [32m'C:\\Users\\user.id\\AppData\\Roaming\\npm-cache\\_npx\\10908'[39m
}

dont name your project in command (npx create-react-app myapp-01).不要在命令中命名您的项目(npx create-react-app myapp-01)。

create your folder and inside that run (npx create-react-app . )创建您的文件夹并在其中运行(npx create-react-app .)

use ( dot )使用(点)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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