Skip to content
This repository was archived by the owner on Feb 1, 2022. It is now read-only.

Commit 2c1ed27

Browse files
committed
fix: use --inspect-brk with Node 8+
Node 8.x no longer has --debug-brk.
1 parent f4ff6ae commit 2c1ed27

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

lib/_inspect.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -96,10 +96,11 @@ function runScript(script, scriptArgs, inspectHost, inspectPort, childPrint) {
9696
return portIsFree(inspectHost, inspectPort)
9797
.then(() => {
9898
return new Promise((resolve) => {
99-
const args = [
100-
'--inspect',
101-
`--debug-brk=${inspectPort}`,
102-
].concat([script], scriptArgs);
99+
const needDebugBrk = process.version.match(/^v(6|7)\./);
100+
const args = (needDebugBrk ?
101+
['--inspect', `--debug-brk=${inspectPort}`] :
102+
[`--inspect-brk=${inspectPort}`])
103+
.concat([script], scriptArgs);
103104
const child = spawn(process.execPath, args);
104105
child.stdout.setEncoding('utf8');
105106
child.stderr.setEncoding('utf8');

0 commit comments

Comments
 (0)