如何修复 npm 错误!解决时:@angular-devkit/bu[email protected] npm ERR!找到:@Angular/[电子邮件受保护]?

2024-01-01

我正在尝试在本地更新 Angular cli 版本,但是每次运行以下命令时,我都会收到以下错误:

npm uninstall --save-dev angular-cli。 (尝试按照所示步骤操作here https://www.angularjswiki.com/angular/update-angular-cli-version-ng-update-to-latest-6-7-versions/)

npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR! 
npm ERR! While resolving: @angular-devkit/[email protected] /cdn-cgi/l/email-protection
npm ERR! Found: @angular/[email protected] /cdn-cgi/l/email-protection
npm ERR! node_modules/@angular/compiler-cli
npm ERR!   dev @angular/compiler-cli@"~12.2.1" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer @angular/compiler-cli@"^15.0.0" from @angular-devkit/[email protected] /cdn-cgi/l/email-protection
npm ERR! node_modules/@angular-devkit/build-angular
npm ERR!   dev @angular-devkit/build-angular@"^15.0.4" from the root project
npm ERR! 
npm ERR! Conflicting peer dependency: @angular/[email protected] /cdn-cgi/l/email-protection
npm ERR! node_modules/@angular/compiler-cli
npm ERR!   peer @angular/compiler-cli@"^15.0.0" from @angular-devkit/[email protected] /cdn-cgi/l/email-protection
npm ERR!   node_modules/@angular-devkit/build-angular
npm ERR!     dev @angular-devkit/build-angular@"^15.0.4" 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 install,我也会得到以下信息:

npm ERR! code ERESOLVE
npm ERR! ERESOLVE could not resolve
npm ERR! 
npm ERR! While resolving: @angular-devkit/[email protected] /cdn-cgi/l/email-protection
npm ERR! Found: @angular/[email protected] /cdn-cgi/l/email-protection
npm ERR! node_modules/@angular/compiler-cli
npm ERR!   dev @angular/compiler-cli@"~12.2.1" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer @angular/compiler-cli@"^15.0.0" from @angular-devkit/[email protected] /cdn-cgi/l/email-protection
npm ERR! node_modules/@angular-devkit/build-angular
npm ERR!   dev @angular-devkit/build-angular@"^15.0.4" from the root project
npm ERR! 
npm ERR! Conflicting peer dependency: @angular/[email protected] /cdn-cgi/l/email-protection
npm ERR! node_modules/@angular/compiler-cli
npm ERR!   peer @angular/compiler-cli@"^15.0.0" from @angular-devkit/[email protected] /cdn-cgi/l/email-protection
npm ERR!   node_modules/@angular-devkit/build-angular
npm ERR!     dev @angular-devkit/build-angular@"^15.0.4" 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 安装 --force

ng 更新 @angular/core@15 @angular/cli@15 --force

还要输入此命令,这样您就不必再次使用 --force。这应该可以解决依赖冲突

npm 配置设置legacy-peer-deps true

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

如何修复 npm 错误!解决时:@angular-devkit/bu[email protected] npm ERR!找到:@Angular/[电子邮件受保护]? 的相关文章

随机推荐

  • 图书馆的异常处理策略

    构建 NET 库时 您的异常处理策略是什么 具体来说 您关于处理库调用内的异常并将其暴露给调用代码的政策是什么 例如 您是否会像对待其他函数一样对待库函数 从而让它无法处理的所有异常按原样流出 您会为该库创建自定义异常吗 您会捕获所有异常并
  • Fixtures、Selenium 和 Rails(天哪?)

    Rails 应用程序上的 Selenium 测试使用哪些数据 你从固定装置加载吗 使用现有的开发数据库 使用单独的 非固定装置 数据库 我正在考虑我的选择 我有一个 Rails 应用程序 其中包含一个大型 Selenium 测试套件 该套件
  • 使用 jqueryhammer.js 2 和事件委托长按(按住)

    我最近升级到hammer js 2 我注意到的第一件事就是 按住 已被 按下 取代 我的旧代码在事件委托方面工作得很好 但切换到按下似乎只有当我将其放在特定元素上时才有效 注意 我通过jquery插件使用hammer js 锤子 js 1
  • 将组件存储在状态中是个好主意吗?

    将整个 React 组件存储在组件状态或 redux 状态中是一个好习惯吗 是的 它是可选的 因为我们可以在状态中存储字符串并有条件地渲染组件 但在某些情况下 将组件存储在状态中更简单 例如 const components useStat
  • 证书中的“主题”是什么意思? [关闭]

    Closed 这个问题不符合堆栈溢出指南 help closed questions 目前不接受答案 相关链接是这个MSDN 文章 http msdn microsoft com en us library bfsktky3 VS 80 a
  • getaddrinfo addrinfo 结果在堆栈或堆中

    至少我有点困惑 getaddrinfo 调用 更新 指向 addrinfo 结构的指针 当我要在同一范围 该函数 中使用 addrinfo 时一切都很好 但是如果我将该结构复制到另一个结构 通过分配它 会发生什么 请帮助我了解正在进行的基础
  • 在 mongodb 集群上创建第一个管理员用户时出现错误“无法添加用户:管理员未授权执行命令”

    我在谷歌云计算引擎中使用版本 3 4 的 mongoDB Cluster 实际上上周我的数据库受到了黑客的攻击 这就是为什么我考虑使用授权 这样我就可以避免这些类型的攻击 现在要添加授权我看到了这篇文章如何创建 mongodb 复制集群 h
  • 堆栈上的总变量大小是否有限制?

    在编码时 我们是否应该考虑对堆栈上创建的变量的总大小进行一些限制 如果是 我们应该根据什么来决定 它取决于操作系统 内存可用性等吗 是否有任何编译器选项可以检查这一点 任何指向该方向的指示也会有所帮助 这是 C 标准中不太用户友好的领域之一
  • 使用 EF 6 alpha3 Code First 和迁移创建 __MigrationHistory 表部署到 SQL Azure 时出错

    我首先使用 EF 6 alpha 3 代码 当我尝试运行 Update Database 命令在 SQL Azure 上创建数据库时 出现以下错误 此版本的 SQL Server 不支持没有聚集索引的表 请创建聚集索引并重试 我追踪到 Mi
  • 如何在 ASP.NET MVC 中创建友好的 URL?

    如何在 ASP NET MVC 框架中生成友好的 URL 例如 我们有一个如下所示的 URL http site catalogue BrowseByStyleLevel 1 1 是要浏览的学习级别 在本例中为较高级别 的 Id 但我想以与
  • 从 JTable 单元格获取值

    我在 Jtable 中创建了一个可编辑的列 完成单元格编辑后 我想要单元格中的旧值 您可以通过使用来获取该值 table getModel getValueAt row index col index where table是表的名称 它将
  • 如何使用 Shapeless 通用提取字段名称?

    给定一个案例类别A我可以使用以下代码片段使用 Shapeless 提取其字段名称 val fieldNames List String import shapeless import shapeless ops record Keys va
  • Flutter 任务 ':audioplayers:compileDebugKotlin' 执行失败

    我尝试安装audioplayers 0 17 1并运行我的扑动项目 它抛出以下错误 有人可以帮忙吗 e C Users User flutter pub cache hosted pub dartlang org audioplayers
  • Java HashMap 与 Int 数组

    我正在使用此代码来检查数组是否存在于HashMap public class Test public static void main String arg HashMap
  • iOS 9 中的 RTL 语言行为

    我们的应用程序支持 RTL 语言 如阿拉伯语 波斯语 iOS 9 之后 导航控制器和选项卡栏控制器的行为已更改 我只找到这个链接ios 9 禁用从右到左语言的支持 https stackoverflow com questions 3169
  • 存储不返回字符串离子

    我已经实施了Ionic 存储 https ionicframework com docs storage 不知道这是不是新的存储值的东西 我创建了一项服务来存储object 它有效 因为我有 console logged 它 但是当我想要g
  • 如何在 Visual Studio 中更改 SVN URL

    在我的办公室 我有一个工作存储库 我可以在笔记本电脑上修改文件并将它们提交到该存储库 我为此使用本地 URL 它直接指向包含存储库的 PC 此外 我们还为外部用户发布了此存储库 因此他们无需在我们的本地网络上即可对存储库进行更改 那里一切都
  • 使用 mongoDB C# 驱动程序,如何发出 runCommand?

    mongoDB API 文档似乎缺乏这方面的内容 我正在尝试使用聚合函数来获取某个集合中流行标签的计数 这是我要执行的命令 db runCommand aggregate articles pipeline unwind Tags grou
  • Android NDK 和 pthread

    我正在使用 android NDK 独立工具链编译 Qt C 项目 我使用 make standalone toolchain sh arch arm toolchain arm linux androideabi 4 9 platform
  • 如何修复 npm 错误!解决时:@angular-devkit/bu[email protected] npm ERR!找到:@Angular/[电子邮件受保护]?

    我正在尝试在本地更新 Angular cli 版本 但是每次运行以下命令时 我都会收到以下错误 npm uninstall save dev angular cli 尝试按照所示步骤操作here https www angularjswik