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
I'm writing this little tool. Everything works as expected with regards to subcommands etc. However, if I package the application with @yao-pkg/pkg I receive the following error while trying to execute a subcommand:
throw new Error(executableMissing);
^
Error: 'eth-validator-consolidate' does not exist
- if 'consolidate' is not meant to be an executable command, remove description parameter from '.command()' and use '.description()' instead
- if the default executable name is not suitable, use the executableFile option to supply a custom name or path
- searched for local subcommand relative to directory '/snapshot/eth-validator/dist/cli'
at ChildProcess.<anonymous> (/snapshot/eth-validator/node_modules/commander/lib/command.js:1225:15)
at ChildProcess.emit (node:events:518:28)
at ChildProcess._handle.onexit (node:internal/child_process:291:12)
at onErrorNT (node:internal/child_process:483:16)
at processTicksAndRejections (node:internal/process/task_queues:90:21)
at process.runNextTicks [as _tickCallback] (node:internal/process/task_queues:69:3)
at Function.runMain (pkg/prelude/bootstrap.js:1988:13)
at node:internal/main/run_main_module:36:49
Since everything is working while just running it with the node binary I guess there is something going on during packaging. Maybe you have an alternative how to package commander based applications or you already know this issue? Any help is much appreciated.
Node version: 22.11.0
The text was updated successfully, but these errors were encountered:
A quick reply. There are two ways of using subcommands. Quoting from the README about commands:
There are two ways these can be implemented: using an action handler attached to the command, or as a stand-alone executable file (described in more detail later).
I suggest you use an action handler rather than a stand-alone executable which should avoid problems with pkg changing how the source files are arranged.
(I haven't tried using pkg myself yet, so this advice is in theory.)
Hi,
I'm writing this little tool. Everything works as expected with regards to subcommands etc. However, if I package the application with
@yao-pkg/pkg
I receive the following error while trying to execute a subcommand:Since everything is working while just running it with the node binary I guess there is something going on during packaging. Maybe you have an alternative how to package
commander
based applications or you already know this issue? Any help is much appreciated.Node version:
22.11.0
The text was updated successfully, but these errors were encountered: