Skip to content

Commit bb9741a

Browse files
jasongroutarcanis
authored andcommitted
Clean up node path prepending (#7057)
* Delete unused scriptsPrependNodePath config option. #6382 (e905f74) made this option obsolete. * Do not prepend the node exec path. #6382 (e905f74) made this unnecessary. * Update CHANGELOG.md * Clarify in changelog the --scripts-prepend-node-path is removed because it is obsolete The current behavior after this PR is not to make `--scripts-prepend-node-path` always on, but to have a better default behavior than the option provided.
1 parent 379ed0a commit bb9741a

File tree

3 files changed

+4
-12
lines changed

3 files changed

+4
-12
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ Please add one entry in this file for each change in Yarn's behavior. Use the sa
44

55
## Master
66

7+
- Removes `--scripts-prepend-node-path` as Yarn's default behavior makes this obsolete
8+
9+
[#7057](https://github.com/yarnpkg/yarn/pull/7057/files) - [**Jason Grout**](https://github.com/jasongrout)
10+
711
- Fixes the advisory link printed by `yarn audit`
812

913
[#7091](https://github.com/yarnpkg/yarn/pull/7091) - [**Jakob Krigovsky**](https://github.com/sonicdoe)

src/config.js

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ export type ConfigOptions = {
5050
nonInteractive?: boolean,
5151
enablePnp?: boolean,
5252
disablePnp?: boolean,
53-
scriptsPrependNodePath?: boolean,
5453
offlineCacheFolder?: string,
5554

5655
enableDefaultRc?: boolean,
@@ -177,8 +176,6 @@ export default class Config {
177176
plugnplayUnplugged: Array<string>;
178177
plugnplayPurgeUnpluggedPackages: boolean;
179178

180-
scriptsPrependNodePath: boolean;
181-
182179
workspacesEnabled: boolean;
183180
workspacesNohoistEnabled: boolean;
184181

@@ -484,8 +481,6 @@ export default class Config {
484481
// $FlowFixMe$
485482
this.nonInteractive = !!opts.nonInteractive || isCi || !process.stdout.isTTY;
486483

487-
this.scriptsPrependNodePath = !!opts.scriptsPrependNodePath;
488-
489484
this.requestManager.setOptions({
490485
offline: !!opts.offline && !opts.preferOffline,
491486
captureHar: !!opts.captureHar,

src/util/execute-lifecycle-script.js

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -164,13 +164,6 @@ export async function makeEnv(
164164
const envPath = env[constants.ENV_PATH_KEY];
165165
const pathParts = envPath ? envPath.split(path.delimiter) : [];
166166

167-
// Include the directory that contains node so that we can guarantee that the scripts
168-
// will always run with the exact same Node release than the one use to run Yarn
169-
const execBin = path.dirname(process.execPath);
170-
if (pathParts.indexOf(execBin) === -1) {
171-
pathParts.unshift(execBin);
172-
}
173-
174167
// Include node-gyp version that was bundled with the current Node.js version,
175168
// if available.
176169
pathParts.unshift(path.join(path.dirname(process.execPath), 'node_modules', 'npm', 'bin', 'node-gyp-bin'));

0 commit comments

Comments
 (0)