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

I use "yyy" command in any "xxx" file,there will be a error: con't find module "/path/to/xxx-yyy" #815

Closed
fengzi2016 opened this issue Jun 12, 2018 · 2 comments

Comments

@fengzi2016
Copy link

code :

   //commander.js
    program
    .option('-p, --path <string>','your local path such as ./')
    .command('push <ak> <sk> <ifcli>')
    .action(function (cmd,ak,sk,ifcli) {})

the commander is "lizi"
when I write "lizi push 111 222 yes"
then

Error: Cannot find module 'E:\github\qiuniu-upload\commander-push'
    at Function.Module._resolveFilename (module.js:536:15)
    at Function.Module._load (module.js:466:25)
    at Function.Module.runMain (module.js:676:10)
    at startup (bootstrap_node.js:187:16)
    at bootstrap_node.js:608:3
@shadowspawn
Copy link
Collaborator

I can not reproduce with your example code, but from the error I think you are triggering Git-style sub-commands by using .command() with a description argument like .command("push", "push description").

If that is the issue then you probably want to call .description instead like:

program
    .option('-p, --path <string>','your local path such as ./')
    .command('push <ak> <sk> <ifcli>')
    .description("push description")
    .action(function (cmd,ak,sk,ifcli) {})

@fengzi2016
Copy link
Author

Thanks for the reply , the error was solved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants