甚至,强制或遗留的对等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相关问答推荐

如何在Node js中从MongoDB获取特定数据,使用GET方法?

在Node.js下使用PostgreSQL客户端聚合PostgreSQL中的用户定义类型

如何在RavenDB中执行JS索引?

如何将Node.js与Nuxt.js一起使用?

Nestjs swc 错误:找不到模块项目路径/src/app.module

更新 mongodb 中的交易值

try 使用 pdf.js 时 pdf.getPage 不是函数

合并Shift对象数组以创建最终的排班表

Postgressql的BIGSERIAL自增序列,即使由于唯一约束错误没有创建行,也会自动增加

如果我在父文件夹中运行,子进程生成不起作用

Nodejs 从链接数组中获取数据并保存到 mongodb

响应发送 200 而不是 403

如果我使用像 express 这样的 node 服务器,是否需要 webpack-dev-server

制作一个接受命令行参数的脚本

Connect/Express 中的session和cookieSession中间件有什么区别?

Passport 登录和持久会话

如何解决'npm应该在 node repl之外运行,在你的普通shell中'

Puppeteer 记录在 page.evaluate

Node.js 与 .net 中的异步/等待

避免在弹性 beantalk 中重建 node_modules