简体   繁体   English

安装@ngrx/store 时如何清除错误?

[英]How to clear the error while installing @ngrx/store?

This is the error I'm getting while installing @ngrx/store .这是我在安装@ngrx/store时遇到的错误。 Can anyone help to resolve this error任何人都可以帮助解决此错误

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

Here are the possible solutions you can try:以下是您可以尝试的可能解决方案:

Deleting Node Modules and Cache删除节点模块和缓存

npm v5 and above: npm v5及以上:

npx rimraf ./**/node_modules

npm cache clear --force

npm install @ngrx/store

npm v4 or below: npm v4 或以下:

npm install rimraf -g

rimraf .\**\node_modules

npm cache clear --force

npm install @ngrx/store

Legacy Peer Dependencies旧版对等依赖项

Try to install with the legacy peer dependencies option which will ignore peerDependencies while installing.尝试使用传统的对等依赖项选项进行安装,该选项将在安装时忽略peerDependencies

npm install @ngrx/store --legacy-peer-deps

Force力量

If that doesn't work, then try the force option.如果这不起作用,请尝试强制选项。

npm install @ngrx/store --force

Different Version of @ngrx/store @ngrx/store的不同版本

If none of the options above work, you can try installing a different version of @ngrx/store .如果上述选项都不起作用,您可以尝试安装不同版本的@ngrx/store

npm install @ngrx/store@10.0.0

Different version of node & npm不同版本node & npm

Finally, as a last resort, you can try downgrading or upgrading your node and npm versions.最后,作为最后的手段,您可以尝试降级或升级您的nodenpm版本。

Here are instructions on how to do so.以下是有关如何执行此操作的说明

Hope this helped!希望这有帮助!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM