【问题标题】:How do i make create-react-app install all folders and files?如何让 create-react-app 安装所有文件夹和文件?
【发布时间】:2020-11-10 20:47:30
【问题描述】:

我在使用 create-react-app 时遇到了这个问题。通常,该命令照常工作,但是最近没有创建 src 文件夹,并且 package.json 文件缺少通常存在的行。这是我运行 npx create-react-app sql 时发生的情况:

C:\Users\{hidden}>npx create-react-app sql
npx: installed 98 in 8.439s

Creating a new React app in C:\Users\{hidden}\sql.

Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts with cra-template...
    
yarn add v1.22.4
[1/4] Resolving packages...
[2/4] Fetching packages...
info fsevents@1.2.12: The platform "win32" is incompatible with this module.
info "fsevents@1.2.12" is an optional dependency and failed compatibility check. Excluding it from             
installation.
info fsevents@2.1.2: The platform "win32" is incompatible with this module.
info "fsevents@2.1.2" is an optional dependency and failed compatibility check. Excluding it from     
installation.
[3/4] Linking dependencies...
warning "react-scripts > @typescript-eslint/eslint-plugin > tsutils@3.17.1" has unmet peer dependency     
"typescript@>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev ||     
>= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta".
[4/4] Building fresh packages...
success Saved lockfile.
success Saved 15 new dependencies.
info Direct dependencies
├─ cra-template@1.0.3
├─ react-dom@16.13.1
├─ react-scripts@3.4.1
└─ react@16.13.1
info All dependencies
├─ @babel/helper-member-expression-to-functions@7.10.5
├─ @babel/plugin-syntax-typescript@7.10.4
├─ @babel/plugin-transform-flow-strip-types@7.9.0
├─ @babel/plugin-transform-runtime@7.9.0
├─ @babel/plugin-transform-typescript@7.10.5
├─ @babel/preset-typescript@7.9.0
├─ babel-preset-react-app@9.1.2
├─ cra-template@1.0.3
├─ eslint-config-react-app@5.2.1
├─ react-dev-utils@10.2.1
├─ react-dom@16.13.1
├─ react-error-overlay@6.0.7
├─ react-scripts@3.4.1
├─ react@16.13.1
└─ scheduler@0.19.1
Done in 31.26s.

另外,这里是 package.json 文件:

{
  "name": "sql",
  "version": "0.1.0",
  "private": true,
  "dependencies": {
    "cra-template": "1.0.3",
    "react": "16.13.1",
    "react-dom": "16.13.1",
    "react-scripts": "3.4.1"
  }
}

命令在这里结束,它不会超过最后一行,而在它之前会。我很困惑,希望有任何帮助,谢谢。

【问题讨论】:

  • 您好,感谢您的回复。不幸的是,我已经通过这个线程,问题仍然存在
  • 当你说你正在使用npx create-react-app sql时,为什么它说C:\Users\{hidden}>yarn create react-app sql
  • 嗨,这是一个错误,但是,无论我使用 npx 还是 yarn 都会再次出现相同的错误。

标签: reactjs npm create-react-app package.json npx


【解决方案1】:

不知道发生了什么,但是当我第二天尝试时,它起作用了。谢天谢地,它现在可以工作了。 PS。我多次删除并安装了create-react-app,但我没有重新启动我的笔记本电脑,也许就是这样

【讨论】:

    猜你喜欢
    • 2018-06-06
    • 1970-01-01
    • 1970-01-01
    • 2020-12-26
    • 1970-01-01
    • 1970-01-01
    • 2018-11-16
    • 2017-12-06
    • 2020-04-07
    相关资源
    最近更新 更多