Skip to content

fix: pass maxBuffer to the pnpm licenses list call#750

Open
joshuaisaact wants to merge 1 commit into
TobyAndToby:mainfrom
joshuaisaact:fix/pnpm-licenses-maxbuffer
Open

fix: pass maxBuffer to the pnpm licenses list call#750
joshuaisaact wants to merge 1 commit into
TobyAndToby:mainfrom
joshuaisaact:fix/pnpm-licenses-maxbuffer

Conversation

@joshuaisaact

Copy link
Copy Markdown

Fixes #749.

getPnpmProjectDependencies calls pnpm licenses list --json --prod via the promisified exec without a maxBuffer, so it uses Node's 1MB default. On a large pnpm monorepo the output is bigger than that and the run throws ERR_CHILD_PROCESS_STDIO_MAXBUFFER before resolving anything. The npm resolver doesn't go through exec so it's unaffected.

This sets an explicit maxBuffer on that call. I picked 256MB as a value that won't realistically be hit; happy to change the number, or switch the call to execFile/streaming instead, if you'd rather handle it differently.

getPnpmProjectDependencies runs `pnpm licenses list --json --prod`
through promisified exec with no maxBuffer, so it falls back to Node's
1MB default. On a large monorepo the JSON output exceeds that and the
call dies with ERR_CHILD_PROCESS_STDIO_MAXBUFFER before any licenses
are resolved.

Set an explicit maxBuffer so large outputs are read in full.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

pnpm resolver crashes with ERR_CHILD_PROCESS_STDIO_MAXBUFFER on large monorepos

1 participant