Skip to content

Commit 2f49dcf

Browse files
kouhinbestander
authored andcommitted
use process.mainModule.filename as npm_execpath (#2843)
1 parent 157a34a commit 2f49dcf

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/util/execute-lifecycle-script.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ async function makeEnv(stage: string, cwd: string, config: Config): {
3030

3131
env.npm_lifecycle_event = stage;
3232
env.npm_node_execpath = env.NODE || process.execPath;
33-
env.npm_execpath = path.join(__dirname, '..', '..', 'bin', 'yarn.js');
33+
env.npm_execpath = env.npm_execpath || process.mainModule.filename;
3434

3535
// Set the env to production for npm compat if production mode.
3636
// https://github.com/npm/npm/blob/30d75e738b9cb7a6a3f9b50e971adcbe63458ed3/lib/utils/lifecycle.js#L336

0 commit comments

Comments
 (0)