我应该如何在我的Angular 10项目中处理npm上的对等依赖性错误?

v8wbuo2f  于 2023-10-19  发布在  Angular
关注(0)|答案(1)|浏览(95)

我正在升级我的angular 10项目,它运行在node 14.x和npm 6.14.x上,

npm ls

在NPM中显示以下问题,

"problems": [
    "peer dep missing: @angular/common@^9.0.0, required by @fullcalendar/[email protected]",
    "peer dep missing: @angular/common@^9.0.0, required by @ng-idle/[email protected]",
    "peer dep missing: @angular/common@^9.0.0, required by @ng-idle/[email protected]",
    "peer dep missing: @angular/common@^9.0.0, required by @ngx-toolkit/[email protected]",
    "peer dep missing: @angular/common@^6.0.0 || ^7.0.0 || ^8.0.0 || ^9.0.0, required by [email protected]",
    "peer dep missing: @angular/core@^9.0.0, required by @fullcalendar/[email protected]",
    "peer dep missing: @angular/core@^9.0.0, required by @ng-idle/[email protected]",
    "peer dep missing: @angular/core@^9.0.0, required by @ng-idle/[email protected]",
    "peer dep missing: @angular/core@^9.0.0, required by @ngx-toolkit/[email protected]",
    "peer dep missing: @angular/core@ ^6.0.0 || ^7.0.0 || ^8.0.0 || ^9.0.0, required by [email protected]",
    "peer dep missing: jest@^24.1.0, required by [email protected]",
    "peer dep missing: tslib@^1.10.0, required by @fullcalendar/[email protected]",
    "peer dep missing: tslib@^1.10.0, required by @ng-idle/[email protected]",
    "peer dep missing: tslib@^1.10.0, required by @ng-idle/[email protected]",
    "peer dep missing: [email protected] - 3, required by [email protected]",
    "peer dep missing: popper.js@^1.16.0, required by [email protected]",
    "peer dep missing: tslib@^1.10.0, required by @fullcalendar/[email protected]",
    "peer dep missing: tslib@^1.10.0, required by @ng-idle/[email protected]",
    "peer dep missing: tslib@^1.10.0, required by @ng-idle/[email protected]",
    "peer dep missing: tslib@^1.10.0, required by @fullcalendar/[email protected]",
    "peer dep missing: tslib@^1.10.0, required by @ng-idle/[email protected]",
    "peer dep missing: tslib@^1.10.0, required by @ng-idle/[email protected]",
    "peer dep missing: jest@^24.1.0, required by [email protected]",
    "peer dep missing: tslib@^1.10.0, required by @fullcalendar/[email protected]",
    "peer dep missing: tslib@^1.10.0, required by @ng-idle/[email protected]",
    "peer dep missing: tslib@^1.10.0, required by @ng-idle/[email protected]",
    "peer dep missing: tslib@^1.10.0, required by @fullcalendar/[email protected]",
    "peer dep missing: tslib@^1.10.0, required by @ng-idle/[email protected]",
    "peer dep missing: tslib@^1.10.0, required by @ng-idle/[email protected]",
    "peer dep missing: tslib@^1.10.0, required by @fullcalendar/[email protected]",
    "peer dep missing: tslib@^1.10.0, required by @ng-idle/[email protected]",
    "peer dep missing: tslib@^1.10.0, required by @ng-idle/[email protected]",
    "peer dep missing: tslib@^1.10.0, required by @fullcalendar/[email protected]",
    "peer dep missing: tslib@^1.10.0, required by @ng-idle/[email protected]",
    "peer dep missing: tslib@^1.10.0, required by @ng-idle/[email protected]",
    "peer dep missing: tslib@^1.10.0, required by @fullcalendar/[email protected]",
    "peer dep missing: tslib@^1.10.0, required by @ng-idle/[email protected]",
    "peer dep missing: tslib@^1.10.0, required by @ng-idle/[email protected]",
    "peer dep missing: tslib@^1.10.0, required by @fullcalendar/[email protected]",
    "peer dep missing: tslib@^1.10.0, required by @ng-idle/[email protected]",
    "peer dep missing: tslib@^1.10.0, required by @ng-idle/[email protected]",
    "peer dep missing: tslib@^1.10.0, required by @fullcalendar/[email protected]",
    "peer dep missing: tslib@^1.10.0, required by @ng-idle/[email protected]",
    "peer dep missing: tslib@^1.10.0, required by @ng-idle/[email protected]",
    "peer dep missing: tslib@^1.10.0, required by @fullcalendar/[email protected]",
    "peer dep missing: tslib@^1.10.0, required by @ng-idle/[email protected]",
    "peer dep missing: tslib@^1.10.0, required by @ng-idle/[email protected]",
    "peer dep missing: tslib@^1.10.0, required by @fullcalendar/[email protected]",
    "peer dep missing: tslib@^1.10.0, required by @ng-idle/[email protected]",
    "peer dep missing: tslib@^1.10.0, required by @ng-idle/[email protected]",
    "peer dep missing: tslib@^1.10.0, required by @fullcalendar/[email protected]",
    "peer dep missing: tslib@^1.10.0, required by @ng-idle/[email protected]",
    "peer dep missing: tslib@^1.10.0, required by @ng-idle/[email protected]",
    "peer dep missing: tslib@^1.10.0, required by @fullcalendar/[email protected]",
    "peer dep missing: tslib@^1.10.0, required by @ng-idle/[email protected]",
    "peer dep missing: tslib@^1.10.0, required by @ng-idle/[email protected]",
    "peer dep missing: tslib@^1.10.0, required by @fullcalendar/[email protected]",
    "peer dep missing: tslib@^1.10.0, required by @ng-idle/[email protected]",
    "peer dep missing: tslib@^1.10.0, required by @ng-idle/[email protected]",
    "peer dep missing: tslib@^1.10.0, required by @fullcalendar/[email protected]",
    "peer dep missing: tslib@^1.10.0, required by @ng-idle/[email protected]",
    "peer dep missing: tslib@^1.10.0, required by @ng-idle/[email protected]",
    "peer dep missing: tslib@^1.10.0, required by @fullcalendar/[email protected]",
    "peer dep missing: tslib@^1.10.0, required by @ng-idle/[email protected]",
    "peer dep missing: tslib@^1.10.0, required by @ng-idle/[email protected]",
    "peer dep missing: tslib@^1.10.0, required by @fullcalendar/[email protected]",
    "peer dep missing: tslib@^1.10.0, required by @ng-idle/[email protected]",
    "peer dep missing: tslib@^1.10.0, required by @ng-idle/[email protected]",
    "peer dep missing: tslib@^1.10.0, required by @fullcalendar/[email protected]",
    "peer dep missing: tslib@^1.10.0, required by @ng-idle/[email protected]",
    "peer dep missing: tslib@^1.10.0, required by @ng-idle/[email protected]",
    "peer dep missing: tslib@^1.10.0, required by @fullcalendar/[email protected]",
    "peer dep missing: tslib@^1.10.0, required by @ng-idle/[email protected]",
    "peer dep missing: tslib@^1.10.0, required by @ng-idle/[email protected]",
    "peer dep missing: tslib@^1.10.0, required by @fullcalendar/[email protected]",
    "peer dep missing: tslib@^1.10.0, required by @ng-idle/[email protected]",
    "peer dep missing: tslib@^1.10.0, required by @ng-idle/[email protected]",
    "peer dep missing: tslib@^1.10.0, required by @fullcalendar/[email protected]",
    "peer dep missing: tslib@^1.10.0, required by @ng-idle/[email protected]",
    "peer dep missing: tslib@^1.10.0, required by @ng-idle/[email protected]",
    "peer dep missing: tslib@^1.10.0, required by @fullcalendar/[email protected]",
    "peer dep missing: tslib@^1.10.0, required by @ng-idle/[email protected]",
    "peer dep missing: tslib@^1.10.0, required by @ng-idle/[email protected]",
    "peer dep missing: jest@>=24 <25, required by [email protected]",
    "peer dep missing: tslib@^1.10.0, required by @fullcalendar/[email protected]",
    "peer dep missing: tslib@^1.10.0, required by @ng-idle/[email protected]",
    "peer dep missing: tslib@^1.10.0, required by @ng-idle/[email protected]",
    "peer dep missing: tslib@^1.10.0, required by @fullcalendar/[email protected]",
    "peer dep missing: tslib@^1.10.0, required by @ng-idle/[email protected]",
    "peer dep missing: tslib@^1.10.0, required by @ng-idle/[email protected]"
  ]

那么我应该怎么做来解决这些问题呢?(请记住,我正在尝试升级node和npm),似乎是peer dependency错误,我应该使用npm install --legacy-peer-deps吗?
解决所有这些对等依赖性错误的解决方案?

bbmckpt7

bbmckpt71#

当将项目升级到Angular的新版本时,最好遵循the angular update guide并使用ng upgrade进行更新。许多第一方Angular软件包相互依赖,只有在使用Angular团队定义的版本时才能一起工作。
任何第三方Angular库(在正确构建时)都会在其package.json中定义peerDependencies,以告诉您他们的包已经过测试并且可能会工作的版本。任何较新的主要版本都不能保证工作。
当看到npm ls的输出时,我认为你可以:

  • 忘记更新第三方Angular软件包,或者
  • 您使用的第三方软件包尚未正式支持您更新到的Angular版本,或者
  • 两个

所以我建议你首先尝试更新你的第三方软件包(最好使用ng update),如果警告仍然存在,就给予你的应用一个尝试。如果它不起作用,那么你必须等待支持...

相关问题