简体   繁体   中英

Nest.js swagger plugin not found under jenkins

With Nest.js i'm using @nestjs/swagger plugin. all works well on dev. in jekins, i'm pulling the code, and doing a build. For that, i have installed nest cli on the server. i'm getting this error at the build stage:

> nest build
Error  "@nestjs/swagger/plugin" plugin could not be found!

what am i doing wrong? server is ubuntu 17, in my nest-cli.json i have this:

{
  "collection": "@nestjs/schematics",
  "sourceRoot": "src",
  "compilerOptions": {
    "plugins": ["@nestjs/swagger/plugin"]
  }
}

and again, it works fine locally. problem is only on jenkins workspace. thanks!

I had exactly the same issue.

I solved it with this:

  1. Make sure you have nestcli installed: npm i -g @nestjs/cli
  2. Update nestcli on deployment before you make npm install: nest update
  3. If this not helps, try another Swagger-Version. I had the problem with version 4.5.9, I upgraded to @nestjs/swagger": "^4.5.11 and it helped.

Hope this works for you.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM