openapistack / openapicmd

The CLI for all things OpenAPI and Swagger
https://openapistack.co
MIT License
55 stars 9 forks source link

Package typegen missing from cli #34

Closed leobaldoneto closed 10 months ago

leobaldoneto commented 1 year ago

How to reproduce? Openapicmd version: 2.0.0-rc17 npm install -g openapicmd openapi typegen Error generated:

ModuleLoadError: [MODULE_NOT_FOUND] require failed to load /home/leo/.nvm/versions/node/v18.15.0/lib/node_modules/openapicmd/lib/commands/typegen.js: Cannot find module 'openapi-client-axios-typegen' Require stack:

  • /home/leo/.nvm/versions/node/v18.15.0/lib/node_modules/openapicmd/lib/commands/typegen.js
  • /home/leo/.nvm/versions/node/v18.15.0/lib/node_modules/openapicmd/node_modules/@oclif/core/lib/module-loader.js
  • /home/leo/.nvm/versions/node/v18.15.0/lib/node_modules/openapicmd/node_modules/@oclif/core/lib/help/index.js
  • /home/leo/.nvm/versions/node/v18.15.0/lib/node_modules/openapicmd/node_modules/@oclif/core/lib/flags.js
  • /home/leo/.nvm/versions/node/v18.15.0/lib/node_modules/openapicmd/node_modules/@oclif/core/lib/cli-ux/styled/table.js
  • /home/leo/.nvm/versions/node/v18.15.0/lib/node_modules/openapicmd/node_modules/@oclif/core/lib/cli-ux/styled/index.js
  • /home/leo/.nvm/versions/node/v18.15.0/lib/node_modules/openapicmd/node_modules/@oclif/core/lib/cli-ux/index.js
  • /home/leo/.nvm/versions/node/v18.15.0/lib/node_modules/openapicmd/node_modules/@oclif/core/lib/index.js at loadWithDataFromManifest (/home/leo/.nvm/versions/node/v18.15.0/lib/node_modules/openapicmd/node_modules/@oclif/core/lib/module-loader.js:113:19) at fetch (/home/leo/.nvm/versions/node/v18.15.0/lib/node_modules/openapicmd/node_modules/@oclif/core/lib/config/plugin.js:182:74) at Plugin.findCommand (/home/leo/.nvm/versions/node/v18.15.0/lib/node_modules/openapicmd/node_modules/@oclif/core/lib/config/plugin.js:200:27) at Object.load (/home/leo/.nvm/versions/node/v18.15.0/lib/node_modules/openapicmd/node_modules/@oclif/core/lib/config/plugin.js:244:36) at Config.runCommand (/home/leo/.nvm/versions/node/v18.15.0/lib/node_modules/openapicmd/node_modules/@oclif/core/lib/config/config.js:397:33) at run (/home/leo/.nvm/versions/node/v18.15.0/lib/node_modules/openapicmd/node_modules/@oclif/core/lib/main.js:85:29) at async /home/leo/.nvm/versions/node/v18.15.0/lib/node_modules/openapicmd/bin/run.js:6:3

It only worked when I installed npm i -g openapi-client-axios-typegen

But typegen documentation says:

Tip: It's recommended to use openapicmd typegen to generate types instead of directly installing the openapi-client-axios-typegen package.

anttiviljami commented 10 months ago

Cannot reproduce with latest versions