title: npm ERR! code ERESOLVE npm ERR! ERESOLVE could not resolve npm ERR! While resolving: @nestjs/mongoose@8.0.1
body: <p>While installing node_modules, I use the <code>--legacy-peer-deps</code> or <code>--force</code> flags. This works fine on windows on my system locally, but it doesn't work while deploying the project in ubuntu server!</p>
  <p>This is the error I get:</p>
  <pre><code>npm ERR! code ERESOLVE
  npm ERR! ERESOLVE could not resolve
  npm ERR! 
  npm ERR! While resolving: @nestjs/mongoose@8.0.1
  npm ERR! Found: mongoose@6.0.1
  npm ERR! node_modules/mongoose
  npm ERR!   mongoose@&quot;6.0.1&quot; from the root project
  npm ERR!   mongoose@&quot;*&quot; from @types/mongoose@5.11.96
  npm ERR!   node_modules/@types/mongoose
  npm ERR!     dev @types/mongoose@&quot;5.11.96&quot; from the root project
  npm ERR!
  npm ERR! Could not resolve dependency:
  npm ERR! peer mongoose@&quot;^5.11.15 || ^5.12.4&quot; from @nestjs/mongoose@8.0.1
  npm ERR! node_modules/@nestjs/mongoose
  npm ERR!
  npm ERR! Conflicting peer dependency: mongoose@5.13.14
  npm ERR! node_modules/mongoose
  npm ERR!   peer mongoose@&quot;^5.11.15 || ^5.12.4&quot; from @nestjs/mongoose@8.0.1
  npm ERR!   node_modules/@nestjs/mongoose
  npm ERR!     @nestjs/mongoose@&quot;8.0.1&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 C:\Users\Admin\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\Admin\AppData\Local\npm-cache\_logs\2022-06-14T08_44_12_502Z-debug-0.log
  </code></pre>