以下是有关问题的详细资料:
npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR!
npm ERR! While resolving: [email protected]
npm ERR! Found: [email protected]
npm ERR! node_modules/typescript
npm ERR! typescript@"^5.3.3" from the root project
npm ERR! peer typescript@">= 2.7" from [email protected]
npm ERR! node_modules/fork-ts-checker-webpack-plugin
npm ERR! fork-ts-checker-webpack-plugin@"^6.5.0" from [email protected]
npm ERR! node_modules/react-dev-utils
npm ERR! react-dev-utils@"^12.0.1" from [email protected]
npm ERR! node_modules/react-scripts
npm ERR! react-scripts@"^5.0.1" from the root project
npm ERR! 1 more (tsutils)
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peerOptional typescript@"^3.2.1 || ^4" from [email protected]
npm ERR! node_modules/react-scripts
npm ERR! react-scripts@"^5.0.1" from the root project
npm ERR!
npm ERR! Conflicting peer dependency: [email protected]
npm ERR! node_modules/typescript
npm ERR! peerOptional typescript@"^3.2.1 || ^4" from [email protected]
npm ERR! node_modules/react-scripts
npm ERR! react-scripts@"^5.0.1" 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!
npm ERR! For a full report see:
npm ERR! /vercel/.npm/_logs/2023-12-07T15_39_01_419Z-eresolve-report.txt
npm ERR! A complete log of this run can be found in: /vercel/.npm/_logs/2023-12-07T15_39_01_419Z-debug-0.log
Error: Command "npm install" exited with 1
字符串
我已经更新了我的节点,npm,ts到最新版本
1条答案
按热度按时间ki0zmccv1#
让我们检查一下
[[email protected]](https://stackoverflow.com/cdn-cgi/l/email-protection)
软件包的对等依赖关系:字符串
这意味着
[[email protected]](https://stackoverflow.com/cdn-cgi/l/email-protection)
包需要typescript@^3.2.1
或typescript@^4
作为其对等依赖项。但是您的项目中安装了[[email protected]](https://stackoverflow.com/cdn-cgi/l/email-protection)
。使用npm v7+会遇到此错误,请参见对等依赖项有两种解决方案:
1.将
typescript
软件包降级为兼容版本。型
1.使用
package.json
的覆盖配置型
请参阅相关问题:issues#13080和issues#13259