-
-
Notifications
You must be signed in to change notification settings - Fork 242
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
ERROR: build:before: None-Zero Exit(7); #14
Comments
Confirming that I'm seeing this on any script that uses |
I'm seeing the same problem here. It looks like this happened after the code refractor patch... |
Seeing this too. Confirmed that it is past 8004ce4 (“Refactoring”). I’ve traced it down to stdout/err problems. When I added a Do this in function spawn(command, args, options) {
var fs = require('fs')
var ofd = fs.openSync('npm-run-all.stdout', 'w')
var efd = fs.openSync('npm-run-all.stderr', 'w')
var out = fs.createWriteStream('', {fd: ofd, flags:'w'});
var err = fs.createWriteStream('', {fd: efd, flags:'w'});
options.detached = true; // eslint-disable-line no-param-reassign
options = {
stdio: [options.stdio[0], out, err]
}
console.log(command, args, options);
var child = _child_process2["default"].spawn(command, args, options);
child.on("exit", removeFromPool);
child.on("error", function(error) {
console.log(error);
removeFromPool()
});
child.kill = kill;
// Add to the pool to kill on exit.
children.push(child);
return child;
} Good luck with this one <3 |
And again as a diff, if that’s easier, full commit here: janl@2889479 branch here: https://github.com/janl/npm-run-all/tree/issue/14 diff --git a/src/lib/spawn-posix.js b/src/lib/spawn-posix.js
index c04abc1..8f10254 100644
--- a/src/lib/spawn-posix.js
+++ b/src/lib/spawn-posix.js
@@ -48,8 +48,18 @@ function kill() {
* @returns {ChildProcess} A ChildProcess instance of new process.
* @private
*/
+
+var fs = require('fs')
export default function spawn(command, args, options) {
+ var ofd = fs.openSync('npm-run-all.stdout', 'w')
+ var efd = fs.openSync('npm-run-all.stderr', 'w')
+ var out = fs.createWriteStream('', {fd: ofd});
+ var err = fs.createWriteStream('', {fd: efd});
+
options.detached = true; // eslint-disable-line no-param-reassign
+ options = {
+ stdio: [options.stdio[0], out, err]
+ }
const child = cp.spawn(command, args, options);
child.on("exit", removeFromPool); |
Oh my God, I apologize for it. My bad, I had not been having tests for stdin/stdout, so these were not tested in Travis CI. |
@janl Thank you for investigating. Hmm, I seem to need changing my strategy that I use process group id to kill child processes. |
Hmm, I'm trying to add tests for this bug, but it works in Travis CI... |
@mysticatea Thanks for great support! |
👍 |
nice! <3 |
Hi,
My project's
package.json
isbuild:before
task is just making directory.v1.2.13 works fine but v1.3.0 has been broken :(
Any suggestions?
Thanks
The text was updated successfully, but these errors were encountered: