I am also facing the same issue, and even when I try to install an older version of Swagger, I still face the same problem.
PS C:\Users\LENOVO\OneDrive\Desktop\practical-round> npm i @nestjs/[email protected]
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: [email protected]
npm ERR! Found: @nestjs/[email protected]
npm ERR! node_modules/@nestjs/common
npm ERR! @nestjs/common@"^10.0.0" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer @nestjs/common@"^9.0.0" from @nestjs/[email protected]
npm ERR! node_modules/@nestjs/swagger
npm ERR! @nestjs/swagger@"6.3.0" 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!
npm ERR! For a full report see:
npm ERR! C:\Users\LENOVO\AppData\Local\npm-cache_logs\2025-04-08T14_34_57_230Z-eresolve-report.txt
npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\LENOVO\AppData\Local\npm-cache_logs\2025-04-08T14_34_57_230Z-debug-0.log