OpenAPITools / openapi-generator-cli

A node package wrapper for https://github.com/OpenAPITools/openapi-generator
Apache License 2.0
1.47k stars 154 forks source link

Cannot read propertie of undefined (reading 'action') #763

Closed StevenHeven closed 8 months ago

StevenHeven commented 8 months ago

Hi,

I come to you because I can't generate my open api files for my front.

When I made this command : openapi-generator-cli generate -i ../../../../front-api/target/openapi.yaml -g typescript-axios -t template/typescript-axios -o ./generated --global-property=skipFormModel=false --additional-properties=supportsES6=true,withInterfaces=true,legacyDiscriminatorBehavior=false

I've this error :

E:\DEV\ITEROPIA\front\src\main\front-end\node_modules\@openapitools\openapi-generator-cli\main.js:693
            commands.get('help').action((_, cmd) => {
                                ^

TypeError: Cannot read properties of undefined (reading 'action')
    at PassThroughService.<anonymous> (E:\DEV\ITEROPIA\front\src\main\front-end\node_modules\@openapitools\openapi-generator-cli\main.js:693:33)
    at Generator.next (<anonymous>)
    at fulfilled (E:\DEV\ITEROPIA\front\src\main\front-end\node_modules\tslib\tslib.js:111:62)
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)

Node.js v20.11.1

I tried many things : delete nodes-modules, update node & npm version, downgrade, clear npm cache, etc. Nothing fix it.

Can you have some idea ?

My ressources : openapi-generator-cli version : 2.5.2 openapitools.json :

{
  "$schema": "./node_modules/@openapitools/openapi-generator-cli/config.schema.json",
  "spaces": 2,
  "generator-cli": {
    "version": "6.6.0"
  }
}
StevenHeven commented 8 months ago

image

When I run in debug mode, I see the maps of command contains only 2 commands ... that's why it found undefined when it need to find command help or other commands ....

StevenHeven commented 8 months ago

Okey forget .... it was jEnv troubles ..... T_____T