-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
TypeError: this.name is not a function #1226
Comments
|
Your solution fixed the issue. Thanks for your answer. |
Just ran into this one as well. Seems like it would be nice to throw an error if someone specifies a |
Opened a PR to add a warning for option name clashes: #1275 |
Hey everyone,
i currently updated to commanderJs 5.0.0 and now some of my command are not working fine when providing the option
name
.Given is the following command with the option name:
program.command('test').description('Logs something').option('-n, --name <value>').action(args => console.log(args.name))
If i run
test
the command works as expected.But if i run
test --name Foo
in my console Commander throws the following error:TypeError: this.name is not a function
at Command._parseCommand (....\node_modules\commander\index.js:910:37)
at Command._dispatchSubcommand (....\node_modules\commander\index.js:860:18)
at Command._parseCommand (....\node_modules\commander\index.js:877:12)
at Command.parse (....\node_modules\commander\index.js:712:10)
I already tried this Avoiding option name clashes
Anyone has any suggestions
The text was updated successfully, but these errors were encountered: