使用 npm 安装模板依赖项...
npm error code ERESOLVE
npm error ERESOLVE unable to resolve dependency tree
npm error
npm error While resolving: [email protected]
npm error Found: [email protected]
npm error node_modules/react
npm error react@"^19.0.0" from the root project
npm error
npm error Could not resolve dependency:
npm error peer react@"^18.0.0" from @testing-library/[email protected]
npm error node_modules/@testing-library/react
npm error @testing-library/react@"^13.0.0" 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
给出解决方案来解决这个问题
如果你确实需要 lib @testing-library/react。您可以使用以下命令安装它:
npm i @testing-library/react
。
PS:@testing-library/[电子邮件受保护]需要react@“^18.0.0”并且create-react-app正在使用react 19