nicojs / node-install-local

Installs npm/yarn packages locally without symlink. Exactly the same as your production installation, no compromises.
106 stars 9 forks source link

RangeError [ERR_CHILD_PROCESS_STDIO_MAXBUFFER]: stderr maxBuffer length exceeded #8

Closed azu closed 6 years ago

azu commented 6 years ago

Env:

node -v
v10.2.1
npm -v
6.1.0

I've tried to install-local for large repository, I met following error.

[install-local] packing - 0/1{ RangeError [ERR_CHILD_PROCESS_STDIO_MAXBUFFER]: stderr maxBuffer length exceeded
    at Socket.onChildStderr (child_process.js:362:14)
    at Socket.emit (events.js:182:13)
    at addChunk (_stream_readable.js:279:12)
    at readableAddChunk (_stream_readable.js:260:13)
    at Socket.Readable.push (_stream_readable.js:219:10)
    at Pipe.onread (net.js:636:20)
  cmd:
   'npm pack /my/large/repo' }

child_process.exec's maxBuffer is 200 * 1024 by default.

Can I avoid this error?

nicojs commented 6 years ago

Thanks for reporting this issue.

I think you're right. I'm using the default buffer size. I suggest setting it to 10MB (1024*1024*10)

Code is here: https://github.com/nicojs/node-install-local/blob/047e35dd6653d69464c8bf1cd23fad4c27e51c3f/src/LocalInstaller.ts#L115

And here: https://github.com/nicojs/node-install-local/blob/047e35dd6653d69464c8bf1cd23fad4c27e51c3f/src/LocalInstaller.ts#L78

I'm happy to accept a PR.

nicojs commented 6 years ago

Released in 0.6.0