Skip to content

Commit 1a15425

Browse files
authored
fix(cpa): properly detect if pnpm exists on windows (#8855)
Use `where <command>` if using windows when detecting package manager
1 parent 9069bd3 commit 1a15425

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/create-payload-app/src/lib/get-package-manager.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ function getEnvironmentPackageManager(): PackageManager {
5454

5555
async function commandExists(command: string): Promise<boolean> {
5656
try {
57-
await execa.command(`command -v ${command}`)
57+
await execa.command(process.platform === 'win32' ? `where ${command}` : `command -v ${command}`)
5858
return true
5959
} catch {
6060
return false

0 commit comments

Comments
 (0)