1
0

More than 3 years have passed since last update.

Swagger-codegenを使おうと思ったが、エラーで使えなかった件

Last updated at Posted at 2020-01-16

発生した問題

swagger-codegenでnodejs-serverを選択し、モックサーバーを立てようとしたら以下のエラーが出た。

Error: Cannot find module './middleware/swagger.router'

パッケージの中を確認すると、確かにswagger.routerがない。
issueが立ってた。パッケージに間違いがあるらしい。
https://github.com/bug-hunters/oas3-tools/issues/17

解決策

Swagger-codegenのバージョンを下げて、
swagger-codegen@2で対応した。

$ brew install swagger-codegen@2

学んだこと

パッケージも間違っていることがある。
npmのサイトにissuesが上がっていることがある。
Weekly downloadsとかが多いものは信頼性がちょっと高い。

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0