1

当尝试在 Angular 11 中更新最新的 ngrx/store 时,它​​会发出安装 Angular 10 的警告。

@ngrx/store@10.1.2 需要 @angular/core@^10.0.0 的对等点,但没有安装。您必须自己安装对等依赖项。

以下是包json

"dependencies": {
"@angular/animations": "^11.0.5",
"@angular/cdk": "^11.0.3",
"@angular/common": "^11.0.5",
"@angular/compiler": "^11.0.5",
"@angular/core": "^11.0.5",
"@angular/forms": "^11.0.5",
"@angular/material": "^11.0.3",
"@angular/material-moment-adapter": "^11.0.3",
"@angular/platform-browser": "^11.0.5",
"@angular/platform-browser-dynamic": "^11.0.5",
"@angular/router": "^11.0.5",
"@fortawesome/fontawesome-free": "^5.15.1",
"@ngrx/store": "^10.1.2",
"@popperjs/core": "^2.6.0",
"bootstrap": "^4.5.3",
"classlist.js": "1.1.20150312",
"core-js": "^3.8.1",
"jquery": "^3.5.1",
"moment": "^2.29.1",
"oidc-client": "^1.10.1",
"popper.js": "^1.16.1",
"rxjs": "~6.6.3",
"sass-loader": "~6.0.7",
"tslib": "^2.0.3",
"web-animations-js": "^2.3.2",
"zone.js": "^0.10.3"

}

npm install 给出以下警告

npm WARN @ngrx/store@10.1.2 requires a peer of @angular/core@^10.0.0 but none is installed. You must install peer dependencies yourself.

如何处理这种情况?

4

1 回答 1

3

完全没问题。

目前(01.01.2021),没有适用于 A11 的 ngrx 版本(没有版本 11),但版本 10 与 A11 完美配合,您可以使用它,尽管有警告。

如果这是您收到的唯一警告,请随意添加--force标志以继续升级。

于 2021-01-01T11:39:46.600 回答