You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

npx create-react-app异常:缺失Public/Src文件夹且npm start无法运行

解决create-react-app项目缺失Public/Src文件夹的问题
  • 卸载全局安装的create-react-app,避免版本冲突:

    npm uninstall -g create-react-app
    

    (使用yarn的话执行 yarn global remove create-react-app)

  • 强制清理npm缓存,清除可能存在的异常缓存文件:

    npm cache clean --force
    
  • 指定最新版本重新创建项目,确保拉取官方最新模板:

    npx create-react-app@latest jsx
    
  • 若仍失败,检查网络环境,可切换npm源尝试(比如淘宝源):

    npm config set registry https://registry.npmmirror.com/
    

    切换完成后重新执行项目创建命令。

  • 检查生成的package.json,正常的create-react-app项目scripts字段应包含start/build等命令,若缺失则说明项目创建不完整,重复上述步骤重试。

内容的提问来源于stack exchange,提问作者Mohammed faiz Khan

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.01 16:01:16