甚至,强制或遗留的对等DEP也不起作用.

记录:

npx create-react-app my-app

Creating a new React app in /home/zahid/my-app.

Installing packages. This might take a couple of minutes.
Installing react, react-dom, and react-scripts with cra-template...

added 1353 packages in 2m

171 packages are looking for funding
  run `npm fund` for details

Initialized a git repository.

Installing template dependencies using npm...
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: my-app@0.1.0
npm ERR! Found: react@18.0.0
npm ERR! node_modules/react
npm ERR!   react@"^18.0.0" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react@"<18.0.0" from @testing-library/react@12.1.5
npm ERR! node_modules/@testing-library/react
npm ERR!   @testing-library/react@"^12.0.0" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR!
npm ERR! See /home/zahid/.npm/eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/zahid/.npm/_logs/2022-04-11T22_25_02_229Z-debug-0.log

npm install --no-audit --save @testing-library/jest-dom@^5.14.1 @testing-library/react@^12.0.0 @testing-library/user-event@^13.2.1 web-vitals@^2.1.0 failed

推荐答案

首先try 运行以下命令:

npm config set legacy-peer-deps true

再试试你的命令.

Node.js相关问答推荐

如何修复PayPal Node.js Webhook中Webhook签名验证失败?''

Mongoose更新在^8.0.3版中,许多似乎不能按预期工作

JEST模拟由http服务器控制器导入的ES模块

如何在Mongoose for MongoDB中编写此查询

如何在医学中按patientId查找一个并同时插入多个数据

如果我在 tsx 文件中使用了use client,ssr 会如何发生?

PEAN auth 应用程序:为什么 Angular 拦截器总是使用BehaviorSubject 返回 null(即初始值),而不是更新后的值?

Next.js 在我的电脑上没有构建错误,但它们在使用 Vercel 部署时发生

加速 sequelize ORM 中的查询

为什么我的 npm 脚本中的 glob 不起作用?

使用 .pipe(res) 向客户端发送音频不允许您搜索?

根据 mongoDB 中存在的唯一字符串生成唯一字符串的最佳方法

为什么在调用数据库调用时我的参数没有定义?

为什么 req.params.id 返回 undefined未定义?

所有的javascript回调都是异步的吗?如果不是,我怎么知道哪些是?

Node.JS 中的基本 HTTP 身份验证?

用一级 try ... catch 捕获 JavaScript Promise 中的错误

在 Jade 包含中使用变量

如何在 NodeJS 中拆分和修改字符串?

我无法全局安装 nodemon,nodemon无法识别