在Angular 13上安装NGX-TOASTR时,无法解决依赖树
在尝试在我的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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这对我有用:
delete node_modules,package-lock.json
更新npm-> sudo npm install -g npm(在Mac上)
运行 - > NPM安装在Angular Project文件夹中
运行NPM安装NGX-TOASTR -force
UPDATE ANGULAR.JSON文件(“样式”阵列)
“ ./node_modules/font-awesome/css/font-awesome.css”
“ ./node_modules/ngx-toastr/toastr.css”
如果您遇到有关“ font-awesome”的错误
运行 - > npm安装 - 保存字体 - 令人陶醉 - force
第二路(这也有效):
https://update.angular.io/
“ ./node_modules/font-awesome/css/font-awesome.css”
“ ./node_modules/ngx-toastr/toastr.css”“
希望这会有所帮助。
This worked for me:
Delete node_modules, package-lock.json
Update npm -> sudo npm install -g npm (on mac)
Run -> npm install in angular project folder
Run npm install ngx-toastr --force
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):
https://update.angular.io/
"./node_modules/font-awesome/css/font-awesome.css"
"./node_modules/ngx-toastr/toastr.css""
Hope this will help.