From 472322de24134cbbdea46a92f69bb0f8c746c538 Mon Sep 17 00:00:00 2001 From: Dotta Date: Wed, 11 Mar 2026 09:31:41 -0500 Subject: [PATCH] Install dependencies after creating worktree Run pnpm install in the new worktree directory before initializing the Paperclip instance so that node_modules are ready when the init step runs. Co-Authored-By: Claude Opus 4.6 --- cli/src/commands/worktree.ts | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/cli/src/commands/worktree.ts b/cli/src/commands/worktree.ts index d511881e..8781b008 100644 --- a/cli/src/commands/worktree.ts +++ b/cli/src/commands/worktree.ts @@ -753,6 +753,19 @@ export async function worktreeMakeCommand(nameArg: string, opts: WorktreeMakeOpt throw new Error(extractExecSyncErrorMessage(error) ?? String(error)); } + const installSpinner = p.spinner(); + installSpinner.start("Installing dependencies..."); + try { + execFileSync("pnpm", ["install"], { + cwd: targetPath, + stdio: ["ignore", "pipe", "pipe"], + }); + installSpinner.stop("Installed dependencies."); + } catch (error) { + installSpinner.stop(pc.yellow("Failed to install dependencies (continuing anyway).")); + p.log.warning(extractExecSyncErrorMessage(error) ?? String(error)); + } + const originalCwd = process.cwd(); try { process.chdir(targetPath);