NestJS 9 was recently released (2 days ago).

https://trilon.io/blog/nestjs-9-is-now-available.

Changes have been made to the @nestjs/swagger package. You are installing the latest version which has peer dependencies on NestJS 9 while your project is still on version 8.4.7.

The error is saying it cannot resolve the requested peer dependency @nestjs/common@^9.0.0. It does find @nestjs/common@8.4.7 instead, but that's not compatible.

Either upgrade NestJS or install an older version of the @nestjs/swagger package that is compatible with the NestJS version your application uses. Version 5.2.1 should work for you.

yarn add @nestjs/swagger@5.2.1
OR
npm i @nestjs/swagger@5.2.1
Answer from Christophe Geers on Stack Overflow
🌐
npm
npmjs.com › package › @nestjs › swagger
@nestjs/swagger - npm
2 weeks ago - Latest version: 11.4.6, last published: 10 days ago. Start using @nestjs/swagger in your project by running `npm i @nestjs/swagger`. There are 2486 other projects in the npm registry using @nestjs/swagger.
      » npm install @nestjs/swagger
    
Published   Jul 17, 2026
Version   11.4.6
🌐
GitHub
github.com › nestjs › swagger
GitHub - nestjs/swagger: OpenAPI (Swagger) module for Nest framework (node.js) :earth_americas: · GitHub
OpenAPI (Swagger) module for Nest. $ npm i --save @nestjs/swagger · Overview & Tutorial · Nest is an MIT-licensed open source project. It can grow thanks to the sponsors and support by the amazing backers. If you'd like to join them, please read more here. Author - Kamil Myśliwiec ·
Author   nestjs
🌐
NestJS
docs.nestjs.com › openapi › introduction
OpenAPI (Swagger) | NestJS - A progressive Node.js ...
Nest is a framework for building efficient, scalable Node.js server-side applications. It uses progressive JavaScript, is built with TypeScript and combines elements of OOP (Object Oriented Programming), FP (Functional Programming), and FRP ...
🌐
Tessl
tessl.io › registry › tessl › npm-nestjs--swagger
11.2.0 • npm-nestjs--swagger • tessl • Registry • Tessl
January 29, 2026 - OpenAPI (Swagger) module for Nest framework enabling automatic API documentation generation from TypeScript decorators ... @nestjs/swagger is the official OpenAPI (Swagger) integration library for NestJS applications.
🌐
Scalar
scalar.com › products › api-references › integrations › nestjs
API Reference for NestJS
This middleware provides an easy way to render a beautiful API reference based on an OpenAPI/Swagger file with NestJS. npm install @scalar/nestjs-api-reference bash ·
🌐
npm
npmjs.com › package › nestjs-swagger-dto
nestjs-swagger-dto - npm
This library combines common @nestjs/swagger, class-transformer and class-validator decorators that are used together into one decorator for full Nest.js DTO lifecycle including OpenAPI schema descriptions.
      » npm install nestjs-swagger-dto
    
Published   Oct 16, 2025
Version   3.8.5
🌐
npm
npmjs.com › package › @concepta › nestjs-swagger-ui
@concepta/nestjs-swagger-ui - npm
Rockets NestJS Swagger UI. Latest version: 7.0.0-alpha.10, last published: 3 months ago. Start using @concepta/nestjs-swagger-ui in your project by running `npm i @concepta/nestjs-swagger-ui`. There are 3 other projects in the npm registry using @concepta/nestjs-swagger-ui.
      » npm install @concepta/nestjs-swagger-ui
    
Published   Nov 21, 2025
Version   7.0.0-alpha.10
Find elsewhere
🌐
npm
npmjs.com › package › @globalart › nestjs-swagger
@globalart/nestjs-swagger - npm
January 7, 2026 - Start using @globalart/nestjs-swagger in your project by running `npm i @globalart/nestjs-swagger`. There are no other projects in the npm registry using @globalart/nestjs-swagger.
      » npm install @globalart/nestjs-swagger
    
Published   Feb 23, 2026
Version   1.3.0
Author   GlobalArt, Inc
🌐
npm
npmjs.com › package › typescript-nestjs-swagger-plugin
typescript-nestjs-swagger-plugin - npm
Latest version: 2.0.0, last published: 3 years ago. Start using typescript-nestjs-swagger-plugin in your project by running `npm i typescript-nestjs-swagger-plugin`. There are 1 other projects in the npm registry ...
      » npm install typescript-nestjs-swagger-plugin
    
Published   Jun 28, 2023
Version   2.0.0
🌐
Medium
rehmat-sayany.medium.com › integrating-swagger-with-nestjs-a-step-by-step-guide-abd532743c43
Integrating Swagger with NestJS: A Step-by-Step Guide | by Rehmat Sayany | Medium
August 11, 2023 - A NestJS project setup. If you don’t have one, you can set it up using the Nest CLI. Start by installing the necessary libraries: npm install @nestjs/swagger swagger-ui-express ·
🌐
npmx
npmx.dev › package › @nestjs › swagger › v › ^10.0.0||^11.0.0
nestjs/swagger
$npm install @nestjs/swagger@11.4.2copy · $pnpm add @nestjs/swagger@11.4.2copy · $yarn add @nestjs/swagger@11.4.2copy · $bun add @nestjs/swagger@11.4.2copy · $deno add npm:@nestjs/swagger@11.4.2copy · $vlt install @nestjs/swagger@11.4.2copy ...
🌐
Medium
arnab-k.medium.com › integrating-swagger-for-api-documentation-in-nestjs-240c852d3a80
Integrating Swagger for API Documentation in NestJS | by @rnab | Medium
January 10, 2025 - NestJS provides a dedicated package for integrating Swagger. Install the package along with its dependencies: npm install --save @nestjs/swagger swagger-ui-express
🌐
Snyk
security.snyk.io › package › npm › @nestjs › swagger
nestjs/swagger
Detailed information and remediation guidance for vulnerabilities.
🌐
Medium
medium.com › @exfabrica › nestjs-une-documentation-dapi-ultime-avec-swagger-e131179e71d5
NestJS : Une documentation d’API ultime avec Swagger | by exFabrica | Medium
June 14, 2022 - Swagger permet bien plus que cette maigre description mais notre story serait bien trop longue. Pour intégrer Swagger dans un projet NestJS, il faut lancer la commande suivante : > npm install — save @nestjs/swagger swagger-ui-express
🌐
GitHub
github.com › nestjs › swagger › releases
Releases · nestjs/swagger
OpenAPI (Swagger) module for Nest framework (node.js) :earth_americas: - Releases · nestjs/swagger
Author   nestjs
🌐
Generalist Programmer
generalistprogrammer.com › home › tutorials › npm packages › nestjs-swagger: modern, fast, powerful node.js web fra guide
Nestjs swagger Guide: modern, fast, powerful node.js web frame [2026]
November 16, 2025 - import nestjs_swagger from '@nestjs/swagger' // TypeScript usage with type safety const result: ReturnType<typeof nestjs_swagger> = nestjs_swagger() Check npm for similar packages - Alternative option
🌐
npm
npmjs.com › package › @byndyusoft › nest-swagger
@byndyusoft/nest-swagger - npm
September 1, 2023 - Latest version: 7.1.9-1, last published: 2 years ago. Start using @byndyusoft/nest-swagger in your project by running `npm i @byndyusoft/nest-swagger`. There are 0 other projects in the npm registry using @byndyusoft/nest-swagger.
      » npm install @byndyusoft/nest-swagger
    
Published   Sep 01, 2023
Version   7.1.9-1
Author   Byndyusoft
🌐
notiz
notiz.dev › blog › openapi-in-nestjs
OpenAPI for your REST APIs in NestJS - notiz.dev
July 28, 2021 - # nest v9 npm install --save @nestjs/swagger class-transformer class-validator # nest v8 # express npm install --save @nestjs/swagger@5 swagger-ui-express class-transformer class-validator # fastify npm install --save @nestjs/swagger@5 ...