Skip to content
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

Cannot use flags --name #24

Closed
FahriDevZ opened this issue Jun 17, 2021 · 6 comments
Closed

Cannot use flags --name #24

FahriDevZ opened this issue Jun 17, 2021 · 6 comments
Assignees
Labels
bug Something isn't working

Comments

@FahriDevZ
Copy link

This is first time i use package commander, and i don't understand where this problem coming.
And how to i use flags --name?

error log:

~/TestNestCommander$ node ./dist/main.js
(node:30) UnhandledPromiseRejectionWarning: Error: option 'name' clashes with existing property 'name' on Command
- call storeOptionsAsProperties(false) to store option values safely,
- or call storeOptionsAsProperties(true) to suppress this check,
- or change option name

Read more on https://git.io/JJc0W
    at Command._checkForOptionNameClash (/home/runner/TestNestCommander/node_modules/commander/index.js:472:13)
    at Command._optionEx (/home/runner/TestNestCommander/node_modules/commander/index.js:499:10)
    at Command.option (/home/runner/TestNestCommander/node_modules/commander/index.js:622:17)
    at CommandRunnerService.setUpCommander (/home/runner/TestNestCommander/node_modules/nest-commander/dist/command-runner.service.js:51:28)
    at CommandRunnerService.onModuleInit (/home/runner/TestNestCommander/node_modules/nest-commander/dist/command-runner.service.js:32:14)
    at process._tickCallback (internal/process/next_tick.js:68:7)
    at Function.Module.runMain (internal/modules/cjs/loader.js:834:11)
    at startup (internal/bootstrap/node.js:283:19)
    at bootstrapNodeJSCore (internal/bootstrap/node.js:623:3)
(node:30) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:30) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Example: https://replit.com/@fahri5567/TestNestCommander

@jmcdo29
Copy link
Owner

jmcdo29 commented Jun 17, 2021

Lots of really good discussion on this over here and in related issues. Looks like there's a better API than what I'm already using, so I'll get the code updated here soon and add in some tests to ensure it keeps working. Thanks for bringing this up

@jmcdo29 jmcdo29 added the bug Something isn't working label Jun 17, 2021
@jmcdo29 jmcdo29 self-assigned this Jun 17, 2021
@jmcdo29
Copy link
Owner

jmcdo29 commented Jun 17, 2021

@FahriDevZ did you mean to close this back out?

@FahriDevZ FahriDevZ reopened this Jun 17, 2021
@FahriDevZ
Copy link
Author

Wow, thanks for your quick reply. Due this issue I temporarily only use single dash :(

@FahriDevZ
Copy link
Author

FahriDevZ commented Jun 18, 2021

Maybe to solve this problem should upgrade the commander.
I've done test test:int with args --name and it worked, however there seems to be a problem with with-questions test 🤔

@jmcdo29
Copy link
Owner

jmcdo29 commented Jun 20, 2021

Looks like this is actually already fixed in commander v7, which I'll have the next version of nest-commander use under the hood.

@jmcdo29
Copy link
Owner

jmcdo29 commented Jul 5, 2021

Okay, this should be fixed in version 1.3.0

@jmcdo29 jmcdo29 closed this as completed Jul 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants