Angulartics2和RXJ之间的依赖关系冲突

发布于 2025-02-09 04:20:30 字数 1245 浏览 1 评论 0原文

我在package.json中有以下依赖关系:

"dependencies": {
 "@angular/animations": "~12.1.0",
 "@angular/common": "~12.1.0",
 "@angular/compiler": "~12.1.0",
 "@angular/core": "~12.1.0",
 "angulartics2": "^11.0.0",
 "rxjs": "~6.6.0",
 "zone.js": "~0.11.4"
},
"devDependencies": {
 "@angular/cli": "~12.1.4",
 "@angular/compiler-cli": "~12.1.0",
 "tslint": "~6.1.3",
 "typescript": "~4.3.2"
}

根据,Angular 12.1.x仅与RXJS 6.5.x/6.6.x兼容 并且根据 angulartics npm npm page ,我应该使用angulartics 11.0.0用于Angular 12.x.x x.x 。

但是,当我启动npm install时,我会收到以下错误:

npm ERR! Could not resolve dependency:
npm ERR! peer rxjs@"^7.0.0" from [email protected]
npm ERR! node_modules/angulartics2
npm ERR!   angulartics2@"^11.0.0" from the root project

因此,基本上是rxj@^7.0.0,但它与我的Angular版本不兼容。
我最好的选择是什么?

I have the following dependencies in my package.json :

"dependencies": {
 "@angular/animations": "~12.1.0",
 "@angular/common": "~12.1.0",
 "@angular/compiler": "~12.1.0",
 "@angular/core": "~12.1.0",
 "angulartics2": "^11.0.0",
 "rxjs": "~6.6.0",
 "zone.js": "~0.11.4"
},
"devDependencies": {
 "@angular/cli": "~12.1.4",
 "@angular/compiler-cli": "~12.1.0",
 "tslint": "~6.1.3",
 "typescript": "~4.3.2"
}

According to this gist, Angular 12.1.x is only compatible with rxjs 6.5.x/6.6.x
And according to the angulartics npm page, I should use angulartics 11.0.0 for Angular 12.x.

But when I launch my npm install I got the following error :

npm ERR! Could not resolve dependency:
npm ERR! peer rxjs@"^7.0.0" from [email protected]
npm ERR! node_modules/angulartics2
npm ERR!   angulartics2@"^11.0.0" from the root project

So basically it is expecting rxj@^7.0.0, but it's not compatible with my Angular version.
What are my best options ?

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

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

发布评论

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

评论(1

梦纸 2025-02-16 04:20:30

我认为最好的选择是更新到Angular V13(或V14),并使用最新版本的Angulartics和最新版本的RXJS。

更新Angular到Last版本具有好处;)

I think the best option is to updated to angular v13 (or v14) and use the latest version of angulartics and the latest version of RxJS.

updating angular to the lastest versions has benefits ;)

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