我正在尝试在我的角度应用程序中安装ngrx。我已经执行了命令
ng添加“ngrx/store”最新内容
但是,它会导致如下错误
npm分辨率错误报告
2022-07T20:36:16.089Z
当解析: crudapp@0.0.0从根项目中找到:@角/核心@13.3.11节点_模块/@角/核心@角/核心@“~13.3.0”
无法解决依赖关系:来自根项目的@ngrx/store@14.0.1节点_模块/@ngrx/store@ngrx/store@14.0.1中的peer @角/core@“^14.0.0”
修复上游依赖冲突,或使用-force或-旧式对等点重新尝试此命令,以接受不正确(且可能损坏的)依赖解决方案。
原始JSON解释对象:
{
"code": "ERESOLVE",
"current": {
"name": "@angular/core",
"version": "13.3.11",
"whileInstalling": {
"name": "crudapp",
"version": "0.0.0",
"path": "/home/Projects/Learning/Angular-ngrx-CRUD/angular-ngrx-crud"
},
"location": "node_modules/@angular/core",
"dependents": [
{
"type": "prod",
"name": "@angular/core",
"spec": "~13.3.0",
"from": {
"location": "/home/Projects/Learning/Angular-ngrx-CRUD/angular-ngrx-crud"
}
}
]
},
"edge": {
"type": "peer",
"name": "@angular/core",
"spec": "^14.0.0",
"error": "INVALID",
"from": {
"name": "@ngrx/store",
"version": "14.0.1",
"whileInstalling": {
"name": "crudapp",
"version": "0.0.0",
"path": "/home/Projects/Learning/Angular-ngrx-CRUD/angular-ngrx-crud"
},
"location": "node_modules/@ngrx/store",
"dependents": [
{
"type": "prod",
"name": "@ngrx/store",
"spec": "14.0.1",
"from": {
"location": "/home/Projects/Learning/Angular-ngrx-CRUD/angular-ngrx-crud"
}
}
]
}
},
"peerConflict": null,
"strictPeerDeps": false,
"force": false
}
有谁知道同样的事吗?我试过一些棱角分明的版本,等等。但不起作用。
发布于 2022-07-07 21:22:18
问题是,有一个不同的版本的角和ngrx/存储,您的项目使用角13,ngrx/存储试图查找角14,因为您使用的命令@最新。解决方案是您可以尝试使用ng add @ngrx/store@13
https://stackoverflow.com/questions/72904021
复制相似问题