Polish the code that sets env in packageJSONContribution.ts (#213306)

This commit is contained in:
Martin Aeschlimann 2024-05-23 11:45:56 +02:00 committed by GitHub
parent 2d174613d4
commit 027fce3efd
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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 {