title: What is the difference between npm install --force and npm install --legacy-peer-deps?
body: <p>I am trying to install node_modules for a project using <code>npm install</code>. But it's failing.</p>
  <p><strong>Error Log</strong> :</p>
  <pre><code>npm ERR! code ERESOLVE
  npm ERR! ERESOLVE unable to resolve dependency tree
  npm ERR! 
  npm ERR! While resolving: my-first-app@0.0.0
  npm ERR! Found: @angular/compiler@11.0.9
  npm ERR! node_modules/@angular/compiler
  npm ERR!   @angular/compiler@&quot;~11.0.0&quot; from the root project
  npm ERR!   peer @angular/compiler@&quot;11.0.9&quot; from @angular/compiler-cli@11.0.9
  npm ERR!   node_modules/@angular/compiler-cli
  npm ERR!     dev @angular/compiler-cli@&quot;~11.0.0&quot; from the root project
  npm ERR!     peer @angular/compiler-cli@&quot;^11.0.0&quot; from @angular-devkit/build-angular@0.1100.7
  npm ERR!     node_modules/@angular-devkit/build-angular
  npm ERR!       dev @angular-devkit/build-angular@&quot;~0.1100.0&quot; from the root project
  npm ERR! 
  npm ERR! Could not resolve dependency:
  npm ERR! peer @angular/compiler@&quot;11.1.2&quot; from @angular/localize@11.1.2
  npm ERR! node_modules/@angular/localize
  npm ERR!   peerOptional @angular/localize@&quot;^11.0.0&quot; from @angular-devkit/build-angular@0.1100.7
  npm ERR!   node_modules/@angular-devkit/build-angular
  npm ERR!     dev @angular-devkit/build-angular@&quot;~0.1100.0&quot; 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 /Users/amit/.npm/eresolve-report.txt for a full report.
  
  npm ERR! A complete log of this run can be found in:
  npm ERR!     /Users/amit/.npm/_logs/2021-02-04T17_58_24_981Z-debug.log
  </code></pre>
  <p>Logs suggest to use either <code>npm install --force</code> or <code>npm install --legacy-peer-deps</code></p>
  <p>I want to understand the basic difference between <code>npm install --force</code> and <code>npm install --legacy-peer-deps</code>.</p>
  <p>Also, which one is more preferable to be used, just in case if performance of <code>--force</code> is better than <code>--legacy-peer-deeps</code> or vice-versa ?</p>
  <p>Any suggestions/pointers are highly appreciable. Thanks!</p>