diff --git a/components/server/src/config/config-inferrer.ts b/components/server/src/config/config-inferrer.ts index 17f9ce59c75849..4a4e3274f03659 100644 --- a/components/server/src/config/config-inferrer.ts +++ b/components/server/src/config/config-inferrer.ts @@ -41,10 +41,13 @@ export class ConfigInferrer { if (!pckjsonContent) { return; } - let command: "yarn" | "npm" = "npm"; + let command: "yarn" | "npm" | "pnpm" = "npm"; if (await ctx.exists("yarn.lock")) { command = "yarn"; } + if (await ctx.exists("pnpm-lock.yaml") || pckjsonContent.packageManager.startsWith("pnpm")) { + command = "pnpm"; + } this.addCommand(ctx.config, command + " install", "init"); try { const pckjson = JSON.parse(pckjsonContent);