Skip to content

Commit

Permalink
Use process.execPath to spawn node subprocess (facebook#8694)
Browse files Browse the repository at this point in the history
  • Loading branch information
anuraaga authored and jmmorris committed Jun 26, 2020
1 parent ed78aea commit 794f4cc
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/react-dev-utils/openBrowser.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ function getBrowserEnv() {

function executeNodeScript(scriptPath, url) {
const extraArgs = process.argv.slice(2);
const child = spawn('node', [scriptPath, ...extraArgs, url], {
const child = spawn(process.execPath, [scriptPath, ...extraArgs, url], {
stdio: 'inherit',
});
child.on('close', code => {
Expand Down
2 changes: 1 addition & 1 deletion packages/react-scripts/bin/react-scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const nodeArgs = scriptIndex > 0 ? args.slice(0, scriptIndex) : [];

if (['build', 'eject', 'start', 'test'].includes(script)) {
const result = spawn.sync(
'node',
process.execPath,
nodeArgs
.concat(require.resolve('../scripts/' + script))
.concat(args.slice(scriptIndex + 1)),
Expand Down

0 comments on commit 794f4cc

Please sign in to comment.