[build-utils] log more around package manager detection (#11594)

Add more loggign around package manager detection to see why we're not
properly detecting `pnpm` given a pnpm lockfile.
This commit is contained in:
Sean Massa
2024-05-13 17:05:25 -05:00
committed by GitHub
parent 14059906d3
commit ad69454352
2 changed files with 7 additions and 9 deletions

View File

@@ -0,0 +1,5 @@
---
"@vercel/build-utils": patch
---
[build-utils] log more around package manager detection

View File

@@ -553,8 +553,9 @@ export function getEnvForPackageManager({
env,
});
const corepackEnabled = env.ENABLE_EXPERIMENTAL_COREPACK === '1';
debug(
`Detected ${detectedPackageManager} with lockfileVersion ${lockfileVersion} (${typeof lockfileVersion}): ${newPath}`
`Detected ${detectedPackageManager} given lockfileVersion "${lockfileVersion}", package manager cli "${cliType}", and corepack enabled? ${corepackEnabled}: ${newPath}`
);
const newEnv: { [x: string]: string | undefined } = {
@@ -772,14 +773,6 @@ export function getPathForPackageManager({
env,
});
debug(
`Detected ${
overrides.detectedPackageManager
} with lockfileVersion ${lockfileVersion} (${typeof lockfileVersion}): ${
overrides.path
}`
);
const alreadyInPath = (newPath: string) => {
const oldPath = env.PATH ?? '';
return oldPath.split(path.delimiter).includes(newPath);