lerna: `stdout maxBuffer exceeded`

There are a few existing closed issues on this, but I am still seeing the error in 2.5.1.

https://github.com/lerna/lerna/issues?utf8=✓&q=is%3Aissue stdout maxBuffer is%3Aclosed

lerna info Bootstrapping 24 packages
lerna info lifecycle preinstall
lerna info Installing external dependencies
lerna ERR! execute callback with error
lerna ERR! Error: stdout maxBuffer exceeded
lerna ERR!     at PassThrough.stream.on (/usr/pnpm-global/1/node_modules/.registry.npmjs.org/get-stream/3.0.0/node_modules/get-stream/index.js:30:12)
lerna ERR!     at emitOne (events.js:120:20)
lerna ERR!     at PassThrough.emit (events.js:210:7)
lerna ERR!     at addChunk (_stream_readable.js:266:12)
lerna ERR!     at readableAddChunk (_stream_readable.js:249:13)
lerna ERR!     at PassThrough.Readable.push (_stream_readable.js:211:10)
lerna ERR!     at PassThrough.Transform.push (_stream_transform.js:147:32)
lerna ERR!     at PassThrough.afterTransform (_stream_transform.js:88:10)
lerna ERR!     at PassThrough._transform (_stream_passthrough.js:42:3)
lerna WARN complete Waiting for 3 child processes to exit. CTRL-C to exit immediately.
(node:7223) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 6): Error: stdout maxBuffer exceeded
(node:7223) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
Executable Version
lerna --version 2.5.1
npm --version 5.5.1
yarn --version 1.0.0
node --version 8.4.0
OS Version
RHEL 5

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Comments: 25 (8 by maintainers)

Most upvoted comments

Same here, still not fixed

lerna ERR! MaxBufferError: stderr maxBuffer exceeded
lerna ERR!     at PassThrough.<anonymous> (/var/local/project/node_modules/get-stream/index.js:41:19)
lerna ERR!     at PassThrough.emit (events.js:322:22)
lerna ERR!     at addChunk (_stream_readable.js:286:12)
lerna ERR!     at readableAddChunk (_stream_readable.js:264:11)
lerna ERR!     at PassThrough.Readable.push (_stream_readable.js:209:10)
lerna ERR!     at PassThrough.Transform.push (_stream_transform.js:152:32)
lerna ERR!     at PassThrough.afterTransform (_stream_transform.js:96:10)
lerna ERR!     at PassThrough._transform (_stream_passthrough.js:46:3)
lerna ERR!     at PassThrough.Transform._read (_stream_transform.js:191:10)
lerna WARN complete Waiting for 19 child processes to exit. CTRL-C to exit immediately.
lerna ERR! lerna stderr maxBuffer exceeded
error Command failed with exit code 1.

I’m having a related issue when using lerna run --parallel with scripts that run for a long time (typically, watch modes).

Under some conditions, those scripts have a very high log output. After a while, the lerna command exits with this error:

lerna ERR! MaxBufferError: stdout maxBuffer exceeded
lerna ERR!     at PassThrough.stream.on (/path/to/my/code/node_modules/@lerna/child-process/node_modules/get-stream/index.js:41:19)
lerna ERR!     at emitOne (events.js:121:20)
lerna ERR!     at PassThrough.emit (events.js:211:7)
lerna ERR!     at addChunk (_stream_readable.js:263:12)
lerna ERR!     at readableAddChunk (_stream_readable.js:246:13)
lerna ERR!     at PassThrough.Readable.push (_stream_readable.js:208:10)
lerna ERR!     at PassThrough.Transform.push (_stream_transform.js:147:32)
lerna ERR!     at PassThrough.afterTransform (_stream_transform.js:88:10)
lerna ERR!     at PassThrough._transform (_stream_passthrough.js:42:3)
lerna WARN complete Waiting for 4 child processes to exit. CTRL-C to exit immediately.
lerna ERR! lerna stdout maxBuffer exceeded
error Command failed with exit code 1.

I’ve never had this issue when launching the individual commands, even with the same high output. Having read other issues in the repo (particularly #278), I also tried the --stream option, but it didn’t seem to work either.

As it is, those lerna runs get interrupted after a while.

Executable Version
lerna --version ^3.4.1
npm --version 6.4.1
yarn --version 1.10.1
node --version 8.12.0
OS Version
MacOS 10.13.6

running with --max-buffer 100000000 still getting those errors frequently. very annoying

lerna ERR! MaxBufferError: stdout maxBuffer exceeded
lerna ERR!     at PassThrough.stream.on (../node_modules/get-stream/index.js:41:19)
lerna ERR!     at PassThrough.emit (events.js:194:15)
lerna ERR!     at addChunk (_stream_readable.js:284:12)
lerna ERR!     at readableAddChunk (_stream_readable.js:261:13)
lerna ERR!     at PassThrough.Readable.push (_stream_readable.js:220:10)
lerna ERR!     at PassThrough.Transform.push (_stream_transform.js:151:32)
lerna ERR!     at PassThrough.afterTransform (_stream_transform.js:92:10)
lerna ERR!     at PassThrough._transform (_stream_passthrough.js:42:3)
lerna ERR!     at PassThrough.Transform._read (_stream_transform.js:190:10)
lerna WARN complete Waiting for 1 child process to exit. CTRL-C to exit immediately.
lerna ERR! lerna stdout maxBuffer exceeded

When hoisting, either with npm or yarn workspaces, you want to avoid postinstall in the root, as it can cause cycles. With yarn, you don’t need it at all, since yarn install does the workspace setup immediately.

On Nov 13, 2017, at 02:23, Benny Neugebauer notifications@github.com wrote:

@evocateur: Thanks for the hint!

I put back the dependencies to their individual packages to make use of Yarn’s workspaces feature. But I also noticed that I get the maxBuffer error when lerna bootstrap is executed within NPM’s postinstall script. Therefore I created a separate script (npm run boot) in my package.json file to run lerna bootstrap:

{ “devDependencies”: { “lerna”: “2.5.1” }, “private”: true, “scripts”: { “boot”: “lerna bootstrap” }, “workspaces”: [ “packages/*” ] } — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.

I suppose we need to figure out a way to avoid wrapping certain execa calls with promises. Passing--max-buffer (or configuring maxBuffer in lerna.json) should have worked, but really the underlying issue is that we shouldn’t be buffering a certain class of execution that we never ever want the output from.

Playing around locally, it seems pretty much any time we call ChildProcessUtilities.exec() the only thing that matters is potential error output…