当前位置: 首页 > article >正文

npx create-react-app react-basic 创建react 项目报错

npx create-react-app创建react 项目报错

npm error code ERESOLVE
npm error ERESOLVE could not resolve
npm error
npm error While resolving: react-basic@0.1.0
npm error Found: react@undefined
npm error node_modules/react
npm error   react@"*" from the root project
npm error
npm error Could not resolve dependency:
npm error react-scripts@"*" from the root project
npm error
npm error Conflicting peer dependency: react@18.3.1
npm error node_modules/react
npm error   peer react@">= 16" from react-scripts@5.0.1
npm error   node_modules/react-scripts
npm error     react-scripts@"*" from the root project
npm error
npm error Fix the upstream dependency conflict, or retry
npm error this command with --force or --legacy-peer-deps
npm error to accept an incorrect (and potentially broken) dependency resolution.
npm error
npm error
npm error For a full report see:
npm error C:\Users\user\AppData\Local\npm-cache\_logs\2024-10-01T09_32_22_760Z-eresolve-report.txt
npm error A complete log of this run can be found in: C:\Users\user\AppData\Local\npm-cache\_logs\2024-10-01T09_32_22_760Z-debug-0.log

解决方法

npm install -g create-react-app

修改镜像

npm config set registry http://registry.npm.taobao.org

再创建一下react项目试一下~

npx create-react-app react-basic

http://www.kler.cn/news/334469.html

相关文章:

  • SpringBoot校园资料平台:从零到一的构建过程
  • Chromium 中JavaScript Fetch API接口c++代码实现(一)
  • iptables 的NDAT报错bash: 9000: command not forward
  • Leetcode—84. 柱状图中最大的矩形【困难】
  • 汇编入门基础
  • vim寄存器使用
  • 大模型扫盲系列——大模型实用技术介绍(上)
  • Concurrently 一键启动客户端和服务器
  • 【学习笔记】一种使用多项式快速计算 sin 和 cos 近似值的方法
  • Python爬虫(二)--http基本原理(Python Crawler (2) Basic Principles of HTTP)
  • C++ 语言特性24 - inline 和 static 关键字
  • 为什么芯片有多个不同的供电电压?
  • Redis几种数据类型的适用场景
  • 开启AI新篇章:探索GPT-4与大模型!订阅方案!简单支付!
  • MySQL的ON DUPLICATE KEY UPDATE和REPLACE INTO
  • 将列表中的各字符串sn连接成为一个字符串s使用;将各sn间隔开os.pathsep.join()
  • Spring Boot大学生就业招聘系统的架构与实现
  • UIAbility组件
  • 父类的final方法能不能够被子类重写?
  • CSP-S 2022 T1假期计划