Skip to content

fix(platform): resolve pnpm via corepack when npm_execpath is absent (#2438)#3038

Open
leno23 wants to merge 1 commit into
nexu-io:mainfrom
leno23:fix/corepack-pnpm-fallback-2438
Open

fix(platform): resolve pnpm via corepack when npm_execpath is absent (#2438)#3038
leno23 wants to merge 1 commit into
nexu-io:mainfrom
leno23:fix/corepack-pnpm-fallback-2438

Conversation

@leno23
Copy link
Copy Markdown

@leno23 leno23 commented May 26, 2026

Fixes #2438

Summary

When npm_execpath is not set (common on Windows Corepack-only setups), nested package-manager invocations from tools-dev now run corepack pnpm … instead of assuming a global pnpm binary is on PATH.

Surface area

  • packages/platform/src/index.tscreatePackageManagerInvocation fallback
  • packages/platform/tests/index.test.ts — updated fallback expectations

Validation

cd packages/platform && pnpm test tests/index.test.ts

Made with Cursor

Nested tools-dev daemon/desktop builds no longer assume a global pnpm
binary on PATH. Fall back to `corepack pnpm …` on Windows and POSIX
so the documented Corepack startup flow works end-to-end.
@lefarcen lefarcen requested a review from mrcfps May 26, 2026 15:57
@lefarcen lefarcen added size/XS PR changes <20 lines risk/medium Medium risk: regular code changes type/bugfix Bug fix labels May 26, 2026
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 33f99b1a18

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines 297 to +300
if (process.platform === "win32") {
return buildCmdShimInvocation("pnpm", args, env);
return buildCmdShimInvocation("corepack", ["pnpm", ...args], env);
}
return { args, command: "pnpm" };
return { args: ["pnpm", ...args], command: "corepack" };
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Keep direct pnpm fallback when npm_execpath is missing

When npm_execpath is absent, this now unconditionally executes corepack pnpm instead of pnpm. In environments where Corepack cannot hydrate its cache (for example fresh machines behind a restrictive proxy/offline) this path fails even if pnpm is already installed globally, which blocks nested tools-dev/tools-pack package-manager calls that previously succeeded. The regression is specifically on the missing-npm_execpath fallback path, so it needs a direct-pnpm fallback when Corepack is unavailable.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Contributor

@lefarcen lefarcen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @leno23, thanks for tying this fix back to #2438 — the Corepack-only Windows fallback is easy to understand from the summary. One quick PR-body cleanup before pool review: could you update ## Surface area to the template checklist and tick the applicable box (likely Default behavior change) instead of listing the touched files only?

Related: #2144 is open in the same package-manager invocation area, and #2445 was an earlier attempt for #2438; useful context for keeping the scope aligned.

Copy link
Copy Markdown
Contributor

@mrcfps mrcfps left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@leno23 I reviewed the changed packages/platform fallback and the matching unit updates, and the no-npm_execpath path now consistently resolves nested package-manager invocations through corepack pnpm on both POSIX and Windows instead of assuming a global pnpm binary. Thanks for tightening up this Windows Corepack startup path — nice, focused fix. 🙌

🔁 Powered by Looper · runner=reviewer · agent=opencode · An autonomous AI dev team for your GitHub repos.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

risk/medium Medium risk: regular code changes size/XS PR changes <20 lines type/bugfix Bug fix

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: Windows source startup fails when tools-dev spawns pnpm without pnpm on PATH

3 participants