Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use child_process.spawn instead of child_process.exec #3

Open
headcr4sh opened this issue Sep 23, 2014 · 0 comments
Open

Use child_process.spawn instead of child_process.exec #3

headcr4sh opened this issue Sep 23, 2014 · 0 comments

Comments

@headcr4sh
Copy link

When using the closure-compiler-stream on many files / a huge amount of JavaScript sources, I receive the following error message:

Error: stdout maxBuffer exceeded.
    at Socket.<anonymous> (child_process.js:689:13)
    at Socket.emit (events.js:95:17)
    at Socket.<anonymous> (_stream_readable.js:764:14)
    at Socket.emit (events.js:92:17)
    at emitReadable_ (_stream_readable.js:426:10)
    at emitReadable (_stream_readable.js:422:5)
    at readableAddChunk (_stream_readable.js:165:9)
    at Socket.Readable.push (_stream_readable.js:127:10)
    at Pipe.onread (net.js:528:21)

I assume (but I am NOT quite sure) that this is due to the fact that child_process.exec buffers everything that is being written to stdout before invoking the callback function. child_process.spawn on the other hand doesn't do that and seems to be a much cleaner solution, therefore.

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

No branches or pull requests

2 participants