【问题标题】:ngx-spinner not installing on Angular 15.0.3ngx-spinner 未安装在 Angular 15.0.3 上
【发布时间】:2023-02-12 11:36:32
【问题描述】:

我有角度版本 15.0.3。 当我尝试使用命令 npm install ngx-spinner 安装 ngx-spinner 时,出现错误

  sashamaksyutenko@MacBook-Pro Client % npm install ngx-spinner
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! While resolving: client@0.0.0
npm ERR! Found: @angular/common@15.0.4
npm ERR! node_modules/@angular/common
npm ERR!   @angular/common@"^15.0.0" from the root project
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer @angular/common@"^14.0.0" from ngx-spinner@14.0.0
npm ERR! node_modules/ngx-spinner
npm ERR!   ngx-spinner@"*" 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 /Users/sashamaksyutenko/.npm/eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/sashamaksyutenko/.npm/_logs/2022-12-21T11_40_00_054Z-debug-0.log
sashamaksyutenko@MacBook-Pro Client % 

【问题讨论】:

    标签: angular15 ngx-spinner


    【解决方案1】:

    从报错信息可以看出,由于版本兼容问题,上游依赖存在冲突。您仍然可以通过附加建议的命令之一来尝试安装该软件包。如果您决定这样做,我建议您选择“--legacy-peer-deps”而不是“--force”。使用“--force”你可能会得到奇怪的意想不到的结果。

    npm install ngx-spinner --legacy-peer-deps
    

    【讨论】:

    • 我用力安装了微调器。款式呢?早些时候我贴了截图。如何在右侧放置相同的按钮和输入?
    【解决方案2】:

    它也给了我同样的错误,所以我用命令卸载了微调器 npm uninstall ngx-spinner 强制重新安装如下 npm 安装 ngx-spinner --force

    希望这可以帮到你。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2022-08-20
      • 1970-01-01
      • 2021-03-24
      • 2021-07-29
      • 2019-08-26
      • 2019-07-19
      • 2021-03-07
      • 1970-01-01
      相关资源
      最近更新 更多