diff --git a/packages/client/test/helpers/ensureBuilt.ts b/packages/client/test/helpers/ensureBuilt.ts index 4611a367c9..5ba15cef5d 100644 --- a/packages/client/test/helpers/ensureBuilt.ts +++ b/packages/client/test/helpers/ensureBuilt.ts @@ -93,7 +93,9 @@ export async function ensureBuilt(pkgDir: string): Promise { try { if (!haveAll()) { try { + // pnpm is a pnpm.cmd shim on Windows, which execFile can only start through a shell. await execFileAsync('pnpm', ['build'], { + shell: process.platform === 'win32', cwd: pkgDir, timeout: BUILD_TIMEOUT_MS, maxBuffer: 16 * 1024 * 1024 diff --git a/packages/server/test/helpers/ensureBuilt.ts b/packages/server/test/helpers/ensureBuilt.ts index e51ce463f9..ff7546bd51 100644 --- a/packages/server/test/helpers/ensureBuilt.ts +++ b/packages/server/test/helpers/ensureBuilt.ts @@ -87,7 +87,9 @@ export async function ensureBuilt(pkgDir: string): Promise { try { if (!haveAll()) { try { + // pnpm is a pnpm.cmd shim on Windows, which execFile can only start through a shell. await execFileAsync('pnpm', ['build'], { + shell: process.platform === 'win32', cwd: pkgDir, timeout: BUILD_TIMEOUT_MS, maxBuffer: 16 * 1024 * 1024