首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >在角13上安装ngx-toastr时,ERESOLVE无法解析依赖树

在角13上安装ngx-toastr时,ERESOLVE无法解析依赖树
EN

Stack Overflow用户
提问于 2022-06-27 09:24:44
回答 1查看 491关注 0票数 0

在我的角度13上安装ngx toastr时出错。

代码语言:javascript
运行
复制
    npm ERR! code ERESOLVE
    npm ERR! ERESOLVE unable to resolve dependency tree
    npm ERR!
    npm ERR! While resolving: p4-padmin@0.0.0
    npm ERR! Found: @angular/common@13.0.3
    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 ngx-toastr@15.0.0
    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
EN

回答 1

Stack Overflow用户

发布于 2022-09-14 13:46:17

这对我起了作用:

package-lock.json

  1. 删除node_modules

  1. 更新-> sudo npm安装-g npm (在mac上)

  1. Run -> npm安装在

项目文件夹中

  1. Run npm安装ngx toastr-force

"./node_modules/font-awesome/css/font-awesome.css“"./node_modules/ngx-toastr/toastr.css""

  1. 更新angular.json文件(”样式“数组)

如果您遇到有关“字体-可怕”的错误,请运行-> npm安装-保存字体-可怕-强制

第二种方式(这也起作用):

按照https://update.angular.io/

  • Run: npm安装ngx-toastr

  • Run: npm安装--保存font-awesome

  • Update angular.json文件(“样式”数组) "./node_modules/font-awesome/css/font-awesome.css“"./node_modules/ngx-toastr/toastr.css""

的说明,

  1. 更新npm

希望这能帮上忙。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/72769748

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档