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

Commit 6b28dec

Browse files
committed
[SQUASH] compat with <7.6.0
1 parent d4680e1 commit 6b28dec

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
@@ -23,6 +23,7 @@
2323
const { spawn } = require('child_process');
2424
const { EventEmitter } = require('events');
2525
const net = require('net');
26+
const semver = require('semver');
2627
const util = require('util');
2728

2829
const runAsStandalone = typeof __dirname !== 'undefined';
@@ -96,10 +97,10 @@ function runScript(script, scriptArgs, inspectHost, inspectPort, childPrint) {
9697
return portIsFree(inspectHost, inspectPort)
9798
.then(() => {
9899
return new Promise((resolve) => {
99-
const args = [
100-
'--inspect',
101-
`--inspect-brk=${inspectPort}`,
102-
].concat([script], scriptArgs);
100+
const args = (semver.satisfies(process.version, '>=7.6.0') ?
101+
[`--inspect-brk=${inspectPort}`] :
102+
['--inspect', `--debug-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)