从' Angular2-flash-messages' import {flashmessagesModule}
我只是在学习。当我在项目中安装了Angular 2 Flash消息模块时,我遇到了这个问题。安装不成功。
npm i angular2-flash-messages
npm err!代码eresolve npm err!无法解决依赖性 树NPM错误! npm err!解决方案时: 找到: @angular/ [email  procectived] node_modules/@angular/core npm 犯错! @angular/core@“^14.0.0”来自root Project npm err! npm err! 无法解决依赖性:npm err! peer @angular/core @“^6.0.0” 来自 root Project npm err! npm err! 修复上游依赖性冲突,或重试NPM ERR!这个命令 使用 - force或-legacy-peer-deps npm err!接受不正确 (并且有可能破坏)依赖性解决方案。 npm err! npm err!看 C:\ USER \ USER \ 报告。
npm err!可以在:
中找到此运行的完整日志
谁面对这个。请告诉我。
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
似乎是一个版本的问题。 Angular2-Flash-Messages仍在使用Angular-Core 6.0.0,并且您使用的是Angular-Core 14输入错误消息。
这些版本之间可能有一些破坏的变化。
我检查了Angular2-Flash-Messages,他们在4年以上没有发布新包装,因此我的建议是选择其他相同的软件包。
您还可以降级角度,可以尝试第12、8版(IVY之前)或6版,但我不建议这样做,因为这样您只能将其粘在该版本上。
另一个选择是自己将软件包更新为较新版本:
https://github.com/moff/moff/angular2-flash-flash-messages
Seems like a versioning problem. angular2-flash-messages is still using Angular-Core 6.0.0 and you are using Angular-core 14 going on the error message.
Probably there are a few breaking changes between these versions.
I checked angular2-flash-messages and they did not publish a new package for over 4 years, so my advise would be to pick some other package that does the same.
You could also downgrade your Angular, you could try version 12, 8 (before Ivy), or 6, but I would not advise this because then you are stuck on that version only for this package.
Yet another option is to update the package to a newer version yourself:
https://github.com/moff/angular2-flash-messages
我今天刚刚解决了这个问题。
当将Angular 12与“@angular/fire”一起使用时发生问题:“ 7.2.1”,并且
“ firebase”:“ 9.6.7”
我这样做时解决的问题:
注意:为什么我添加 ^?因为,我看到了警告,所以红线发生在那些特定的软件包中,所以我猜这些包裹和沃尔(Voile)中有些东西。它起作用。
I have just solved this problem today.
The problem occured when using angular 12 with "@angular/fire": "7.2.1", and
"firebase": "9.6.7"
The problems solved when I did this:
note: Why I added ^ ? Because, I saw the warning, the red line was occured in those particular packages, so I guess something in those packages and voile. It worked.