From 44c710bbf064f0d33d832b3572163c76f4723927 Mon Sep 17 00:00:00 2001 From: shaoyu Date: Thu, 7 Nov 2024 16:10:42 -0800 Subject: [PATCH] fix(yarnpnp): fix cap run command for yarn pnp mode --- cli/src/util/native-run.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/cli/src/util/native-run.ts b/cli/src/util/native-run.ts index acaca2c6c..7ca81f9e4 100644 --- a/cli/src/util/native-run.ts +++ b/cli/src/util/native-run.ts @@ -15,7 +15,11 @@ export async function runNativeRun(args: readonly string[], options: RunCommandO fatal(`${c.input('native-run')} not found.`); } - return await runCommand(p, args, options); + if (process.versions.pnp) { + return await runCommand('yarn', ['node', p, ...args], options); + } else { + return await runCommand(p, args, options); + } } export async function getPlatformTargets(platformName: string): Promise {