在Angular 13上安装NGX-TOASTR时,无法解决依赖树

发布于 2025-02-11 05:34:20 字数 1413 浏览 0 评论 0原文

在尝试在我的Angular 13上安装NGX-TOASTR时,请在低于错误

    npm ERR! code ERESOLVE
    npm ERR! ERESOLVE unable to resolve dependency tree
    npm ERR!
    npm ERR! While resolving: [email protected]
    npm ERR! Found: @angular/[email protected]
    npm ERR! node_modules/@angular/common
    npm ERR!   @angular/common@"~13.0.0" from the root project
    npm ERR!
    npm ERR! Could not resolve dependency:
    npm ERR! peer @angular/common@">=14.0.0-0" from [email protected]
    npm ERR! node_modules/ngx-toastr
    npm ERR!   ngx-toastr@"*" 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\xyz\AppData\Local\npm-cache\eresolve-report.txt for a full report.
    
    npm ERR! A complete log of this run can be found in:
    npm ERR!     C:\Users\xyz\AppData\Local\npm-cache\_logs\2022-06-27T09_19_20_284Z-debug.log

Getting below error while trying to install ngx-toastr on my angular 13

    npm ERR! code ERESOLVE
    npm ERR! ERESOLVE unable to resolve dependency tree
    npm ERR!
    npm ERR! While resolving: [email protected]
    npm ERR! Found: @angular/[email protected]
    npm ERR! node_modules/@angular/common
    npm ERR!   @angular/common@"~13.0.0" from the root project
    npm ERR!
    npm ERR! Could not resolve dependency:
    npm ERR! peer @angular/common@">=14.0.0-0" from [email protected]
    npm ERR! node_modules/ngx-toastr
    npm ERR!   ngx-toastr@"*" 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\xyz\AppData\Local\npm-cache\eresolve-report.txt for a full report.
    
    npm ERR! A complete log of this run can be found in:
    npm ERR!     C:\Users\xyz\AppData\Local\npm-cache\_logs\2022-06-27T09_19_20_284Z-debug.log

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

诗笺 2025-02-18 05:34:20

这对我有用:

  1. delete node_modules,package-lock.json

  2. 更新npm-> sudo npm install -g npm(在Mac上)

  3. 运行 - > NPM安装在Angular Project文件夹中

  4. 运行NPM安装NGX-TOASTR -force

  5. UPDATE ANGULAR.JSON文件(“样式”阵列)
    “ ./node_modules/font-awesome/css/font-awesome.css”
    “ ./node_modules/ngx-toastr/toastr.css”

如果您遇到有关“ font-awesome”的错误
运行 - > npm安装 - 保存字体 - 令人陶醉 - force

第二路(这也有效):

  1. 更新NPM
  2. 更新Angular Application遵循以下说明
    https://update.angular.io/
  3. run> run:npm instal ngx install ngx-tor ngx-tok toastr
  4. run:npm保存字体可感知的
  5. 更新angular.json文件(“样式”数组)
    “ ./node_modules/font-awesome/css/font-awesome.css”
    “ ./node_modules/ngx-toastr/toastr.css”“

希望这会有所帮助。

This worked for me:

  1. Delete node_modules, package-lock.json

  2. Update npm -> sudo npm install -g npm (on mac)

  3. Run -> npm install in angular project folder

  4. Run npm install ngx-toastr --force

  5. Update angular.json file ("styles" array)
    "./node_modules/font-awesome/css/font-awesome.css"
    "./node_modules/ngx-toastr/toastr.css""

if you get error about "font-awesome"
Run -> npm install --save font-awesome --force

Second way (this also worked):

  1. Update npm
  2. Update Angular application following instructions from:
    https://update.angular.io/
  3. Run: npm install ngx-toastr
  4. Run: npm install --save font-awesome
  5. Update angular.json file ("styles" array)
    "./node_modules/font-awesome/css/font-awesome.css"
    "./node_modules/ngx-toastr/toastr.css""

Hope this will help.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文