Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.2k views
in Technique[技术] by (71.8m points)

node.js - How to clear the error while installing @ngrx/store?

This is the error I'm getting while installing @ngrx/store. Can anyone help to resolve this error

PS C:UsersWelcome
grx-test> npm install @ngrx/store
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree     
npm ERR! 
npm ERR! While resolving: [email protected]
npm ERR! Found: @angular/[email protected]
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/[email protected]
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:UsersWelcomeAppDataLocal
pm-cacheeresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:UsersWelcomeAppDataLocal
pm-cache\_logs2021-01-12T15_07_10_434Z-debug.log

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Here are the possible solutions you can try:

Deleting Node Modules and Cache

npm v5 and above:

npx rimraf ./**/node_modules

npm cache clear --force

npm install @ngrx/store

npm v4 or below:

npm install rimraf -g

rimraf .**
ode_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.

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

If none of the options above work, you can try installing a different version of @ngrx/store.

npm install @ngrx/[email protected]

Different version of node & npm

Finally, as a last resort, you can try downgrading or upgrading your node and npm versions.

Here are instructions on how to do so.

Hope this helped!


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...