Skip to content

Commit 371d634

Browse files
authored
fix: set only one PATH env variable for child proc
#22 caused a regression in pnpm when users had a version of npm without the revert and a new version of pnpm with rever #22. Old npm was duplicating the PATH env variables. New pnpm was not overriding all of them. Using only one PATH env variable will reduce uncertainty.
1 parent d7a014f commit 371d634

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -362,7 +362,7 @@ function makeEnv (data, opts, prefix, env) {
362362
if (!env) {
363363
env = {}
364364
for (var i in process.env) {
365-
if (!i.match(/^npm_/)) {
365+
if (!i.match(/^npm_/) && (!i.match(/^PATH$/i) || i === PATH)) {
366366
env[i] = process.env[i]
367367
}
368368
}

0 commit comments

Comments
 (0)