首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >create-react-app不起作用并且是公共的,缺少src文件

create-react-app不起作用并且是公共的,缺少src文件
EN

Stack Overflow用户
提问于 2021-04-20 19:21:30
回答 1查看 141关注 0票数 0

我尝试了很多关于同一个问题的解决方案,但没有一个对我有效。缺少公共的src文件。我也重新安装了NodeJS,但仍然遇到同样的问题。我也尝试过npm install-g create-react-app,但是我仍然面临着同样的问题。

当我使用npx时,这是输出

代码语言:javascript
复制
D:\projects>npx create-react-app trial

Creating a new React app in D:\projects\trial.

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.13: The platform "win32" is incompatible with this module.
info "fsevents@1.2.13" is an optional dependency and failed compatibility check. Excluding it from installation.
info fsevents@2.3.2: The platform "win32" is incompatible with this module.
info "fsevents@2.3.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.20.0" 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 7 new dependencies.
info Direct dependencies
├─ cra-template@1.1.2
├─ react-dom@17.0.2
├─ react-scripts@4.0.3
└─ react@17.0.2
info All dependencies
├─ cra-template@1.1.2
├─ immer@8.0.1
├─ react-dev-utils@11.0.4
├─ react-dom@17.0.2
├─ react-scripts@4.0.3
├─ react@17.0.2
└─ scheduler@0.20.2
Done in 166.85s.

我尝试使用纱线,但仍然得到相同的结果。

代码语言:javascript
复制
   D:\projects>yarn create react-app my-app
    yarn create v1.22.4
    [1/4] Resolving packages...
    [2/4] Fetching packages...
    info fsevents@1.2.13: The platform "win32" is incompatible with this module.
    info "fsevents@1.2.13" is an optional dependency and failed compatibility check. Excluding it from installation.
    [3/4] Linking dependencies...
    [4/4] Building fresh packages...
    
    success Installed "create-react-app@4.0.3" with binaries:
          - create-react-app
    
    Creating a new React app in D:\projects\my-app.
    
    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.13: The platform "win32" is incompatible with this module.
    info "fsevents@1.2.13" is an optional dependency and failed compatibility check. Excluding it from installation.
    info fsevents@2.3.2: The platform "win32" is incompatible with this module.
    info "fsevents@2.3.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.20.0" 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 7 new dependencies.
    info Direct dependencies
    ├─ cra-template@1.1.2
    ├─ react-dom@17.0.2
    ├─ react-scripts@4.0.3
    └─ react@17.0.2
    info All dependencies
    ├─ cra-template@1.1.2
    ├─ immer@8.0.1
    ├─ react-dev-utils@11.0.4
    ├─ react-dom@17.0.2
    ├─ react-scripts@4.0.3
    ├─ react@17.0.2
    └─ scheduler@0.20.2
    Done in 278.06s.
EN

回答 1

Stack Overflow用户

发布于 2021-04-20 19:40:02

无可奉告,但你是否进入了create-react-app创建的文件夹?因此,在您的示例中,它应该是类似于projects/my-app或projects/trial的内容

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/67177922

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档