Skip to content

Commit

Permalink
Fix: Use process.env.NODE to find node executable
Browse files Browse the repository at this point in the history
  • Loading branch information
Tyler Kellen authored and phated committed Dec 17, 2018
1 parent 20d5853 commit cb4e0e3
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions fetch.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@ const fs = require('fs');
const path = require('path');

const exec = require('child_process').exec;
const nodepath = process.env._;
// this is from the env of npm, not node
const nodePath = process.env.NODE;
const version = process.versions.v8;
const tmpfile = path.join(__dirname, version+'.flags.json');

if (!fs.existsSync(tmpfile)) {
exec(nodepath+' --v8-options', function (execErr, result) {
exec(nodePath+' --v8-options', function (execErr, result) {
var flags;
if (execErr) {
throw new Error(execErr);
Expand Down

0 comments on commit cb4e0e3

Please # to comment.