Skip to content

Commit

Permalink
[build-utils] log more around package manager detection (#11594)
Browse files Browse the repository at this point in the history
Add more loggign around package manager detection to see why we're not
properly detecting `pnpm` given a pnpm lockfile.
  • Loading branch information
EndangeredMassa committed May 13, 2024
1 parent 1405990 commit ad69454
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 9 deletions.
5 changes: 5 additions & 0 deletions .changeset/calm-peaches-occur.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@vercel/build-utils": patch
---

[build-utils] log more around package manager detection
11 changes: 2 additions & 9 deletions packages/build-utils/src/fs/run-user-scripts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 } = {
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit ad69454

Please sign in to comment.