Skip to content

Commit

Permalink
Update install-package.ts
Browse files Browse the repository at this point in the history
pnpx was removed in pnpm v7 and replaced by pnpm exec and pnpm dlx.

pnpm dlx works the same as yarn dlx.
  • Loading branch information
66Leo66 committed Jun 4, 2024
1 parent ff8004f commit 9569a86
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/purple-pears-divide.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'astro': patch
---

Suggest `pnpm dlx` instead of `pnpx` in update check.
4 changes: 2 additions & 2 deletions packages/astro/src/cli/install-package.ts
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ function getInstallCommand(packages: string[], packageManager: string) {
}

/**
* Get the command to execute and download a package (e.g. `npx`, `yarn dlx`, `pnpx`, etc.)
* Get the command to execute and download a package (e.g. `npx`, `yarn dlx`, `pnpm dlx`, etc.)
* @param packageManager - Optional package manager to use. If not provided, Astro will attempt to detect the preferred package manager.
* @returns The command to execute and download a package
*/
Expand All @@ -114,7 +114,7 @@ export async function getExecCommand(packageManager?: string): Promise<string> {
case 'yarn':
return 'yarn dlx';
case 'pnpm':
return 'pnpx';
return 'pnpm dlx';
case 'bun':
return 'bunx';
default:
Expand Down

0 comments on commit 9569a86

Please sign in to comment.