-
-
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
Sub-commands do not work with package.json main #1044
Comments
Yes, for resolving subcommand executables Commander expects The approach I often use is a setup closer to the eventual install. So with a
Instead of
(You could work-around the current design in your own code by supplying |
Related issue, when calling from Electron app: #512 |
Closing as covered by #512 |
Consider the following setup:
lib/index.js
lib/myUpdateSubCommand.js
package.json
What works:
What does not work:
$ node . update error: ./myUpdateSubCommand(1) does not exist, try --help
Expected Behavior
It's expected that executing
node . update
yields the same result as executingnode dist/index.js update
.Where the problem is:
The path to the sub-command is determined from argv[1], which does not take into consideration the path assigned to the
main
property inpackage.json
.Version
"commander": "^3.0.1",
The text was updated successfully, but these errors were encountered: