Skip to content

Commit 9e4325e

Browse files
anuraagaabhiisheek
authored andcommitted
Use process.execPath to spawn node subprocess (facebook#8694)
1 parent d8494f9 commit 9e4325e

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

packages/react-dev-utils/openBrowser.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ function getBrowserEnv() {
4545

4646
function executeNodeScript(scriptPath, url) {
4747
const extraArgs = process.argv.slice(2);
48-
const child = spawn('node', [scriptPath, ...extraArgs, url], {
48+
const child = spawn(process.execPath, [scriptPath, ...extraArgs, url], {
4949
stdio: 'inherit',
5050
});
5151
child.on('close', code => {

packages/react-scripts/bin/react-scripts.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ const nodeArgs = scriptIndex > 0 ? args.slice(0, scriptIndex) : [];
2626

2727
if (['build', 'eject', 'start', 'test'].includes(script)) {
2828
const result = spawn.sync(
29-
'node',
29+
process.execPath,
3030
nodeArgs
3131
.concat(require.resolve('../scripts/' + script))
3232
.concat(args.slice(scriptIndex + 1)),

0 commit comments

Comments
 (0)