从' Angular2-flash-messages' import {flashmessagesModule}

发布于 2025-02-04 23:06:10 字数 1365 浏览 3 评论 0 原文

I'm just learning. I ran into this problem when I installed the Angular 2 flash messages module in my project. The installation was not successful.

npm i angular2-flash-messages

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/core npm
ERR! @angular/core@"^14.0.0" from the root project npm ERR! npm ERR!
Could not resolve dependency: npm ERR! peer @angular/core@"^6.0.0"
from [email protected] npm ERR!
node_modules/angular2-flash-messages npm ERR!
angular2-flash-messages@"*" 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\Никита\AppData\Local\npm-cache\eresolve-report.txt for a full
report.

npm ERR! A complete log of this run can be found in:

Who faced this. please tell me.

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

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

发布评论

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

评论(2

相守太难 2025-02-11 23:06:10

似乎是一个版本的问题。 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

心安伴我暖 2025-02-11 23:06:10

我今天刚刚解决了这个问题。
当将Angular 12与“@angular/fire”一起使用时发生问题:“ 7.2.1”,并且
“ firebase”:“ 9.6.7”

我这样做时解决的问题:

  1. 转到包装。 :“ ^ 9.6.7”
  2. 然后我完全删除了Node_modules文件夹
  3. :npm安装
  4. 问题已解决的

注意:为什么我添加 ^?因为,我看到了警告,所以红线发生在那些特定的软件包中,所以我猜这些包裹和沃尔(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:

  1. go to package.json, I added ^ (carret) to these packages: "@angular/fire": "^7.2.1" and "firebase": "^9.6.7"
  2. then I deleted node_modules folder entirely
  3. run: npm install
  4. the problem solved

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.

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