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

Strage bug (in upstream node core?) #680

Closed
akayami opened this issue Aug 20, 2017 · 3 comments
Closed

Strage bug (in upstream node core?) #680

akayami opened this issue Aug 20, 2017 · 3 comments

Comments

@akayami
Copy link

akayami commented Aug 20, 2017

Node:
v8.4.0

When I run the following code (bug.js):

#!/usr/bin/env node

const program = require('commander');

	program
		.version('0.0.1')
		.option('-n --name [name]', 'Specify name of this vhost')
		.option('-p --port [port]', 'Specify port')
		.option('-r --protocol [protocol]', 'Specify protocol (http or https)')
		.option('-t --target [target]', 'Specify the target endpoint')
		.option('-d --domain [domain]', 'Specify the domain name')
		
	program.parse(process.argv);

with the following command:

node bug.js -n test -r https -p 8080 -d "sdsd" -t "12312"

I get this:

events.js:198
    domain.enter();
           ^

TypeError: domain.enter is not a function
    at Command.emit (events.js:198:12)
    at Command.parseOptions (/home/tomasz/dev/hardbox-cli/node_modules/commander/index.js:719:14)
    at Command.parse (/home/tomasz/dev/hardbox-cli/node_modules/commander/index.js:454:21)
    at Object.<anonymous> (/home/tomasz/dev/hardbox-cli/bug.js:13:10)
    at Module._compile (module.js:573:30)
    at Object.Module._extensions..js (module.js:584:10)
    at Module.load (module.js:507:32)
    at tryModuleLoad (module.js:470:12)
    at Function.Module._load (module.js:462:3)
    at Function.Module.runMain (module.js:609:10)

It seems to only happen when i use '--domain'. Anything else I tried works fine (ex: '--domain1')

It does look like an upstream bug, but I want to double check.

@roman-vanesyan
Copy link
Collaborator

Unfortunately, currently commander doesn't support properties/methods of Node.js' EventEmitter, plus those which it defines itself as an option/command. It's known issue and is misimplementation from the early ages of commander.

@akayami
Copy link
Author

akayami commented Aug 20, 2017

This would be something to keep an eye on when building 3.0. Such a hugely popular module should be rock solid.

@roman-vanesyan
Copy link
Collaborator

roman-vanesyan commented Aug 20, 2017

Duplication of #284, which is similar to #681, #105.
Closed. Keep your eyes on #105 issue, thx

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