【发布时间】:2021-04-17 13:41:39
【问题描述】:
这是我在安装@ngrx/store 时遇到的错误。谁能帮忙解决这个错误
PS C:\Users\Welcome\ngrx-test> npm install @ngrx/store
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: ngrx-test@0.0.0
npm ERR! Found: @angular/core@11.0.8
npm ERR! node_modules/@angular/core
npm ERR! @angular/core@"~11.0.1" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer @angular/core@"^10.0.0" from @ngrx/store@10.1.2
npm ERR! node_modules/@ngrx/store
npm ERR! @ngrx/store@"*" 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\Welcome\AppData\Local\npm-cache\eresolve-report.txt for a full report.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Welcome\AppData\Local\npm-cache\_logs\2021-01-12T15_07_10_434Z-debug.log
【问题讨论】:
-
尝试重新安装ngrx-store后尝试删除node_module并清除缓存。有时它是由于缓存而发生的。
-
曾尝试使用命令-> npm cache clean --force,但它不起作用给定命令是否正确@Abhishek
-
在运行此命令
npm cache clear --force之后您是否尝试过删除node_module? -
删除节点模块后尝试..但显示相同的错误