From 027fce3efdd48232c3d8e0eab7abb3c3a3e38d43 Mon Sep 17 00:00:00 2001 From: Martin Aeschlimann Date: Thu, 23 May 2024 11:45:56 +0200 Subject: [PATCH] Polish the code that sets env in packageJSONContribution.ts (#213306) --- extensions/npm/src/features/packageJSONContribution.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/extensions/npm/src/features/packageJSONContribution.ts b/extensions/npm/src/features/packageJSONContribution.ts index 03913d0a8de..a2f4fabcfe3 100644 --- a/extensions/npm/src/features/packageJSONContribution.ts +++ b/extensions/npm/src/features/packageJSONContribution.ts @@ -292,7 +292,7 @@ export class PackageJSONContribution implements IJSONContribution { // COREPACK_ENABLE_AUTO_PIN disables the package.json overwrite, and // COREPACK_ENABLE_PROJECT_SPEC makes the npm view command succeed // even if packageManager specified a package manager other than npm. - const env = { COREPACK_ENABLE_AUTO_PIN: "0", COREPACK_ENABLE_PROJECT_SPEC: "0" }; + const env = { ...process.env, COREPACK_ENABLE_AUTO_PIN: '0', COREPACK_ENABLE_PROJECT_SPEC: '0' }; cp.execFile(npmCommandPath, args, { cwd, env }, (error, stdout) => { if (!error) { try {