diff --git a/code/lib/cli/src/initiate.ts b/code/lib/cli/src/initiate.ts index f66c49492d30..db26d2efb071 100644 --- a/code/lib/cli/src/initiate.ts +++ b/code/lib/cli/src/initiate.ts @@ -327,7 +327,7 @@ async function doInitiate(options: CommandOptions, pkg: PackageJson): Promise { return this.executeCommand({ command: 'npm', - args: ['exec', '--', command, ...args], + args: ['run', command, '--', ...args], cwd, }); } diff --git a/code/lib/cli/src/js-package-manager/PNPMProxy.ts b/code/lib/cli/src/js-package-manager/PNPMProxy.ts index 4ddaeb6fcda3..246a2d3a2210 100644 --- a/code/lib/cli/src/js-package-manager/PNPMProxy.ts +++ b/code/lib/cli/src/js-package-manager/PNPMProxy.ts @@ -83,7 +83,7 @@ export class PNPMProxy extends JsPackageManager { ): string { return this.executeCommandSync({ command: 'pnpm', - args: ['exec', command, ...args], + args: ['run', command, ...args], cwd, stdio, }); @@ -92,7 +92,7 @@ export class PNPMProxy extends JsPackageManager { async runPackageCommand(command: string, args: string[], cwd?: string): Promise { return this.executeCommand({ command: 'pnpm', - args: ['exec', command, ...args], + args: ['run', command, ...args], cwd, }); }