【问题标题】:create react app error: TypeError: Cannot read property 'split' of undefined创建反应应用程序错误:TypeError:无法读取未定义的属性“拆分”
【发布时间】:2021-04-23 20:28:48
【问题描述】:

我刚刚创建了一个名为 client 的文件夹并运行了命令

npx create-react-app ./

之后,当我跑步时

npm start

我收到以下错误。

TypeError: Cannot read property 'split' of undefined
    at processModule (C:\Users\Vishruth S\NodeJS_progs\mernstack\client\node_modules\eslint-webpack-plugin\dist\index.js:93:38)
    at SyncHook.eval [as call] (eval at create (C:\Users\Vishruth S\NodeJS_progs\mernstack\client\node_modules\tapable\lib\HookCodeFactory.js:19:10), <anonymous>:5:1)
    at SyncHook.lazyCompileHook (C:\Users\Vishruth S\NodeJS_progs\mernstack\client\node_modules\tapable\lib\Hook.js:154:20)
    at C:\Users\Vishruth S\NodeJS_progs\mernstack\client\node_modules\webpack\lib\Compilation.js:781:30
    at MultiModule.build (C:\Users\Vishruth S\NodeJS_progs\mernstack\client\node_modules\webpack\lib\MultiModule.js:39:10)
    at Compilation.buildModule (C:\Users\Vishruth S\NodeJS_progs\mernstack\client\node_modules\webpack\lib\Compilation.js:739:10)
    at C:\Users\Vishruth S\NodeJS_progs\mernstack\client\node_modules\webpack\lib\Compilation.js:1111:12
    at MultiModuleFactory.create (C:\Users\Vishruth S\NodeJS_progs\mernstack\client\node_modules\webpack\lib\MultiModuleFactory.js:18:3)
    at C:\Users\Vishruth S\NodeJS_progs\mernstack\client\node_modules\webpack\lib\Compilation.js:1063:18
    at Semaphore.acquire (C:\Users\Vishruth S\NodeJS_progs\mernstack\client\node_modules\webpack\lib\util\Semaphore.js:29:4)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! client@0.1.0 start: `react-scripts start`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the client@0.1.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\Vishruth S\AppData\Roaming\npm-cache\_logs\2021-01-19T14_02_31_823Z-debug.log

我没有修改默认 create-react-app 中的任何文件,但我无法运行它。任何帮助表示赞赏。

【问题讨论】:

    标签: reactjs npm create-react-app


    【解决方案1】:

    你需要写

    npx create-react-app client
    

    以上行将在'client'文件夹下创建一个react项目 您不必手动创建任何东西

    如果需要,请查看文档

    【讨论】:

      【解决方案2】:

      命令不应该是:

      npx create-react-app .

      【讨论】:

      • 哦,我实际上是新手,我正在按照 youtube 教程中的命令进行操作
      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2019-12-22
      • 1970-01-01
      • 2020-08-09
      • 2021-12-26
      • 2022-01-06
      • 2022-09-27
      • 2020-09-07
      相关资源
      最近更新 更多