diff --git a/CHANGELOG.md b/CHANGELOG.md index 29df3cb430..56f03616d4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,10 @@ Please add one entry in this file for each change in Yarn's behavior. Use the sa ## Master +- Removes `--scripts-prepend-node-path` as Yarn's default behavior makes this obsolete + + [#7057](https://github.com/yarnpkg/yarn/pull/7057/files) - [**Jason Grout**](https://github.com/jasongrout) + - Fixes the advisory link printed by `yarn audit` [#7091](https://github.com/yarnpkg/yarn/pull/7091) - [**Jakob Krigovsky**](https://github.com/sonicdoe) diff --git a/src/config.js b/src/config.js index 033b204d90..2fdf5ff162 100644 --- a/src/config.js +++ b/src/config.js @@ -50,7 +50,6 @@ export type ConfigOptions = { nonInteractive?: boolean, enablePnp?: boolean, disablePnp?: boolean, - scriptsPrependNodePath?: boolean, offlineCacheFolder?: string, enableDefaultRc?: boolean, @@ -177,8 +176,6 @@ export default class Config { plugnplayUnplugged: Array; plugnplayPurgeUnpluggedPackages: boolean; - scriptsPrependNodePath: boolean; - workspacesEnabled: boolean; workspacesNohoistEnabled: boolean; @@ -484,8 +481,6 @@ export default class Config { // $FlowFixMe$ this.nonInteractive = !!opts.nonInteractive || isCi || !process.stdout.isTTY; - this.scriptsPrependNodePath = !!opts.scriptsPrependNodePath; - this.requestManager.setOptions({ offline: !!opts.offline && !opts.preferOffline, captureHar: !!opts.captureHar, diff --git a/src/util/execute-lifecycle-script.js b/src/util/execute-lifecycle-script.js index 03b1cb4ae2..02dc6b29c0 100644 --- a/src/util/execute-lifecycle-script.js +++ b/src/util/execute-lifecycle-script.js @@ -164,13 +164,6 @@ export async function makeEnv( const envPath = env[constants.ENV_PATH_KEY]; const pathParts = envPath ? envPath.split(path.delimiter) : []; - // 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 - 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. pathParts.unshift(path.join(path.dirname(process.execPath), 'node_modules', 'npm', 'bin', 'node-gyp-bin'));