【问题标题】:npm install ngx-toastr --save -> Could not resolve dependency: peer @angular/core@"12.0.3" from @angular/common@12.0.3npm install ngx-toastr --save -> 无法解析依赖:来自@angular/common@12.0.3 的对等@angular/core@"12.0.3"
【发布时间】:2021-08-26 06:32:08
【问题描述】:

我的版本:

  • Angular CLI:11.2.7
  • 节点:14.15.5

我的 package.json 依赖项

 "dependencies": {
    "@angular/animations": "~11.2.8",
    "@angular/cdk": "^11.2.12",
    "@angular/common": "^12.0.3",
    "@angular/compiler": "~11.2.8",
    "@angular/core": "~11.2.8",
    "@angular/forms": "~11.2.8",
    "@angular/material": "^11.2.12",
    "@angular/platform-browser": "~11.2.8",
    "@angular/platform-browser-dynamic": "~11.2.8",
    "@angular/router": "~11.2.8",
    "@videogular/ngx-videogular": "^3.0.1",
    "axios": "^0.21.1",
    "bootstrap": "^5.0.0-beta3",
    "ng-uikit-pro-standard": "^1.0.0",
    "rxjs": "~6.6.0",
    "tslib": "^2.0.0",
    "video.js": "^7.11.8",
    "zone.js": "~0.11.3"
  },

当我尝试安装 npm install ngx-toastr --save

npm ERR! Found: @angular/core@11.2.14
npm ERR! node_modules/@angular/core
npm ERR!   @angular/core@"~11.2.8" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer @angular/core@"12.0.3" from @angular/common@12.0.3
npm ERR! node_modules/@angular/common
npm ERR!   @angular/common@"^12.0.3" from the root project
npm ERR!   peer @angular/common@">=12.0.0-0" from ngx-toastr@14.0.0
npm ERR!   node_modules/ngx-toastr
npm ERR!     ngx-toastr@"*" from the root project

toastr 依赖项的任何版本不匹配?请帮忙。

【问题讨论】:

    标签: node.js angular npm-install


    【解决方案1】:

    你试过安装 ngx-toastr@12.x 吗?

    【讨论】:

      【解决方案2】:

      此错误出现在最新的稳定版本(14.0.0)中。

      我尝试安装一个最旧的版本,它成功了

      npm install ngx-toastr@13.2.1 --save
      

      Angular CLI:11.2.14

      节点:v15.0.1

      【讨论】:

        猜你喜欢
        • 2021-08-27
        • 2021-05-12
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 1970-01-01
        • 2023-02-09
        • 2021-10-14
        • 2021-05-01
        相关资源
        最近更新 更多