You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Adding the option .option('--no-emit', 'description') to a command results in the following error when running bin cmd -h:
/mnt/c/code/tony-lang/cli/node_modules/commander/index.js:1495
this.emit(this._helpLongFlag);
^
TypeError: this.emit is not a function
at Command.outputHelp (/mnt/c/code/tony-lang/cli/node_modules/commander/index.js:1495:10)
at outputHelpIfRequested (/mnt/c/code/tony-lang/cli/node_modules/commander/index.js:1645:9)
at Command._parseCommand (/mnt/c/code/tony-lang/cli/node_modules/commander/index.js:893:7)
at Command._dispatchSubcommand (/mnt/c/code/tony-lang/cli/node_modules/commander/index.js:860:18)
at Command._parseCommand (/mnt/c/code/tony-lang/cli/node_modules/commander/index.js:877:12)
at Command.parse (/mnt/c/code/tony-lang/cli/node_modules/commander/index.js:712:10)
at Object.<anonymous> (/mnt/c/code/tony-lang/cli/dist/index.js:26:20)
at Module._compile (internal/modules/cjs/loader.js:1151:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1171:10)
at Module.load (internal/modules/cjs/loader.js:1000:32)
Is this expected?
The text was updated successfully, but these errors were encountered:
The problem is due to a clash of your option name with the properties of the Command object, in this case the emit method from EventListener. The value for the --no-emit flag is stored as the emit property and overwrites the expected method.
To resolve the problem, you may opt-in to a new way of storing the option values using .storeOptionsAsProperties(false) which was added specifically to avoid this sort of problem.
Adding the option
.option('--no-emit', 'description')
to a command results in the following error when runningbin cmd -h
:Is this expected?
The text was updated successfully, but these errors were encountered: