gpt4 book ai didi

angular - ERESOLVE 无法解析依赖树?

转载 作者:行者123 更新时间:2023-12-05 01:29:58 24 4
gpt4 key购买 nike

当您尝试通过 Angular CLI 创建 Angular 项目时,您会收到此错误

    npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: animation@0.0.0
npm ERR! Found: jasmine-core@3.6.0
npm ERR! node_modules/jasmine-core
npm ERR! dev jasmine-core@"~3.6.0" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer jasmine-core@">=3.7.1" from karma-jasmine-html-reporter@1.6.0
npm ERR! node_modules/karma-jasmine-html-reporter
npm ERR! dev karma-jasmine-html-reporter@"^1.5.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.

请帮帮我,我不明白这里需要做什么

最佳答案

更新( Angular 12.0.0)

就在我回答后几个小时,Angular 12 发布了——它与 NPM 7.13.0 完美配合。

原始答案(Angular 11.2.11)

您使用的是哪个 NPM 版本?

我刚刚在使用版本 7.10.0 时遇到了同样的问题。降级到 6.14.13 后,ng new 按预期工作。

npm i -g npm@6.14.13

目前,如果您想创建一个 Angular 项目,这似乎是最好的解决方案。然而,相应的Issue on GitHub已经关闭了。所以我希望下一个 Angular 版本也能与最新的 NPM 版本一起工作。

希望能帮到你。

关于angular - ERESOLVE 无法解析依赖树?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/67464883/

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