From 2fc4fadd7ce2b2617d7226f50e267c41cd091532 Mon Sep 17 00:00:00 2001 From: Yuri Kanivetsky Date: Mon, 30 Jul 2018 12:00:57 +0300 Subject: [PATCH] Make yarn not to add /usr/bin to PATH if already there --- src/util/execute-lifecycle-script.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/util/execute-lifecycle-script.js b/src/util/execute-lifecycle-script.js index adbb4624c5..f155d30d53 100644 --- a/src/util/execute-lifecycle-script.js +++ b/src/util/execute-lifecycle-script.js @@ -144,7 +144,10 @@ export async function makeEnv( // Include the directory that contains node so that we can guarantee that the scripts // will always run with the exact same Node release than the one use to run Yarn - pathParts.unshift(path.dirname(process.execPath)); + const execBin = path.dirname(process.execPath); + if (pathParts.indexOf(execBin) === -1) { + pathParts.unshift(execBin); + } // Include node-gyp version that was bundled with the current Node.js version, // if available.