Skip to content

Commit

Permalink
NODE_OPTIONS is available in 8.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
goto-bus-stop committed Aug 15, 2018
1 parent 0420249 commit 56fb442
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
5 changes: 3 additions & 2 deletions autocannon.js
Expand Up @@ -8,7 +8,7 @@ const os = require('os')
const net = require('net')
const path = require('path')
const URL = require('url').URL
const nitm = require('nitm')
const spawn = require('child_process').spawn
const managePath = require('manage-path')
const hasAsyncHooks = require('has-async-hooks')
const help = fs.readFileSync(path.join(__dirname, 'help.txt'), 'utf8')
Expand Down Expand Up @@ -193,9 +193,10 @@ function start (argv) {
const alterPath = managePath({ PATH: process.env.NODE_PATH })
alterPath.unshift(path.join(__dirname, 'lib/preload'))

nitm(['-r', 'autocannonDetectPort'], argv.spawn, {
spawn(argv.spawn[0], argv.spawn.slice(1), {
stdio: ['ignore', 'inherit', 'inherit'],
env: Object.assign({}, process.env, {
NODE_OPTIONS: ['-r', 'autocannonDetectPort'].join(' '),
NODE_PATH: alterPath.get(),
AUTOCANNON_SOCKET: socketPath
})
Expand Down
1 change: 0 additions & 1 deletion package.json
Expand Up @@ -52,7 +52,6 @@
"hyperid": "^1.4.1",
"manage-path": "^2.0.0",
"minimist": "^1.2.0",
"nitm": "^1.0.2",
"on-net-listen": "^1.1.1",
"pretty-bytes": "^5.1.0",
"progress": "^2.0.0",
Expand Down

0 comments on commit 56fb442

Please sign in to comment.