这是我在安装@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发布于 2021-01-13 04:10:42
以下是您可以尝试的可能解决方案:
删除节点模块和缓存
npm v5及以上版本:
npx rimraf ./**/node_modules
npm cache clear --force
npm install @ngrx/storenpm v4或以下版本:
npm install rimraf -g
rimraf .\**\node_modules
npm cache clear --force
npm install @ngrx/store传统对等依赖项
尝试使用传统对等依赖项选项进行安装,该选项将在安装时忽略peerDependencies。
npm install @ngrx/store --legacy-peer-deps力
如果这不起作用,那么尝试force选项。
npm install @ngrx/store --force不同版本的@ngrx/store
如果以上选项都不起作用,您可以尝试安装不同版本的@ngrx/store。
npm install @ngrx/store@10.0.0不同版本的node和npm
最后,作为最后的手段,您可以尝试降级或升级您的node和npm版本。
下面是关于如何做到这一点的instructions。
希望这能有所帮助!
https://stackoverflow.com/questions/65686763
复制相似问题