gpt4 book ai didi

reactjs - 创建 ionic 应用 React 时,npm 无法解析依赖树

转载 作者:行者123 更新时间:2023-12-04 17:21:19 24 4
gpt4 key购买 nike

我已经尝试删除所有 npm 包,卸载 ionic 和许多其他东西,但我无法通过此错误。我什至验证了 typescript 和 react-script 的版本存在(就像在另一个版本不存在的帖子中一样)

完整日志:

λ ionic start myApp
? Framework: React
? Starter template: sidemenu
? .\myApp exists. Overwrite? Yes
√ Preparing directory .\myApp in 10.64ms
√ Downloading and extracting sidemenu starter in 830.02ms
> ionic integrations enable capacitor --quiet -- myApp io.ionic.starter
> npm.cmd i --save -E @capacitor/core
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! Found: typescript@4.1.3
npm ERR! node_modules/typescript
npm ERR! typescript@"4.1.3" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peerOptional typescript@"^3.2.1" from react-scripts@4.0.1
npm ERR! node_modules/react-scripts
npm ERR! react-scripts@"4.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! See C:\Users\<user>\AppData\Local\npm-cache\eresolve-report.txt for a full report.
> npm.cmd i
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! Found: typescript@4.1.3
npm ERR! node_modules/typescript
npm ERR! typescript@"4.1.3" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peerOptional typescript@"^3.2.1" from react-scripts@4.0.1
npm ERR! node_modules/react-scripts
npm ERR! react-scripts@"4.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! See C:\Users\<user>\AppData\Local\npm-cache\eresolve-report.txt for a full report.

最佳答案

事实上,我们需要使用 --legacy-peer-deps,而不是尝试 --force 命令大约 10 次。也许武力并非处处都是好的选择。

npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps

关于reactjs - 创建 ionic 应用 React 时,npm 无法解析依赖树,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/66030850/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com