{"action":"created","issue":{"url":"https://api.github.com/repos/tj/commander.js/issues/533","repository_url":"https://api.github.com/repos/tj/commander.js","labels_url":"https://api.github.com/repos/tj/commander.js/issues/533/labels{/name}","comments_url":"https://api.github.com/repos/tj/commander.js/issues/533/comments","events_url":"https://api.github.com/repos/tj/commander.js/issues/533/events","html_url":"https://github.com/tj/commander.js/issues/533","id":154756409,"number":533,"title":"error Error: listen EADDRINUSE :::5858 when using node debug","user":{"login":"alexklibisz","id":8015228,"avatar_url":"https://avatars.githubusercontent.com/u/8015228?v=3","gravatar_id":"","url":"https://api.github.com/users/alexklibisz","html_url":"https://github.com/alexklibisz","followers_url":"https://api.github.com/users/alexklibisz/followers","following_url":"https://api.github.com/users/alexklibisz/following{/other_user}","gists_url":"https://api.github.com/users/alexklibisz/gists{/gist_id}","starred_url":"https://api.github.com/users/alexklibisz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexklibisz/subscriptions","organizations_url":"https://api.github.com/users/alexklibisz/orgs","repos_url":"https://api.github.com/users/alexklibisz/repos","events_url":"https://api.github.com/users/alexklibisz/events{/privacy}","received_events_url":"https://api.github.com/users/alexklibisz/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2016-05-13T16:55:21Z","updated_at":"2016-10-29T01:41:29Z","closed_at":null,"body":"I'm using node 6.0.0 and commander ^2.9.0. I'm trying to use the built-in node debugger to inspect at some breakpoints.\r\n\r\n## Case 1: If I run a script that doesn't use commander, it works:\r\n\r\nsrc/cli/works.js:\r\n```\r\nvar x = 5;\r\nsetTimeout(() => {\r\n  debugger;\r\n  console.log('world');\r\n}, 1000);\r\nconsole.log('hello');\r\n```\r\n```\r\n$ node debug src/cli/works.js \r\n< Debugger listening on port 5858\r\nconnecting to 127.0.0.1:5858 ... ok\r\nbreak in src/cli/works.js:1\r\n> 1 var x = 5;\r\n  2 setTimeout(() => {\r\n  3   debugger;\r\ndebug> cont\r\n< hello\r\nbreak in src/cli/works.js:3\r\n  1 var x = 5;\r\n  2 setTimeout(() => {\r\n> 3   debugger;\r\n  4   console.log('world');\r\n  5 }, 1000);\r\ndebug> cont\r\n< world\r\ndebug> \r\n```\r\n\r\n## Case 2: If I run my commander script without `debug`, it also works:\r\n\r\nsrc/cli/cli.js\r\n```\r\nconst\r\n  cli = require('commander'),\r\n  pkg = require('../../package.json');\r\n\r\ncli\r\n  .version(pkg.version)\r\n  .command('grid', 'creates grid-style visualization')\r\n  .parse(process.argv);\r\n```\r\n\r\nsrc/cli/cli-grid.js\r\n```\r\ndebugger;\r\nconsole.log('grid');\r\n```\r\n\r\n```\r\n$ node src/cli/cli.js grid\r\ngrid\r\n```\r\n\r\n## Case 3: But if I run a script with the commander *and* the `debug` option, it gives the following error:\r\n\r\n```\r\n$ node debug src/cli/cli.js grid\r\n< Debugger listening on port 5858\r\nconnecting to 127.0.0.1:5858 ... ok\r\nbreak in src/cli/cli.js:1\r\n> 1 const\r\n  2   cli = require('commander'),\r\n  3   pkg = require('../../package.json');\r\ndebug> cont\r\n< Error: listen EADDRINUSE :::5858\r\n<     at Object.exports._errnoException (util.js:896:11)\r\n<     at exports._exceptionWithHostPort (util.js:919:20)\r\n<     at Agent.Server._listen2 (net.js:1246:14)\r\n<     at listen (net.js:1282:10)\r\n<     at Agent.Server.listen (net.js:1378:5)\r\n<     at Object.start (_debug_agent.js:21:9)\r\n<     at startup (node.js:85:44)\r\n<     at node.js:444:3\r\ndebug> cont\r\ndebug> cont\r\ndebug> cont\r\n```\r\n\r\nSo it seems that there's some sort of issue being cause by using the debugger and commander at the same time. I've searched other issues, but found nothing directly relevant. Thanks in advance."},"comment":{"url":"https://api.github.com/repos/tj/commander.js/issues/comments/257063411","html_url":"https://github.com/tj/commander.js/issues/533#issuecomment-257063411","issue_url":"https://api.github.com/repos/tj/commander.js/issues/533","id":257063411,"user":{"login":"alexklibisz","id":8015228,"avatar_url":"https://avatars.githubusercontent.com/u/8015228?v=3","gravatar_id":"","url":"https://api.github.com/users/alexklibisz","html_url":"https://github.com/alexklibisz","followers_url":"https://api.github.com/users/alexklibisz/followers","following_url":"https://api.github.com/users/alexklibisz/following{/other_user}","gists_url":"https://api.github.com/users/alexklibisz/gists{/gist_id}","starred_url":"https://api.github.com/users/alexklibisz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alexklibisz/subscriptions","organizations_url":"https://api.github.com/users/alexklibisz/orgs","repos_url":"https://api.github.com/users/alexklibisz/repos","events_url":"https://api.github.com/users/alexklibisz/events{/privacy}","received_events_url":"https://api.github.com/users/alexklibisz/received_events","type":"User","site_admin":false},"created_at":"2016-10-29T01:41:29Z","updated_at":"2016-10-29T01:41:29Z","body":"If it's considered fixed please feel free to close it. I had forgotten I opened it! :)"}}
{"actor":{"display_login":"alexklibisz"}}