Gulp: process does not exit

Created on 16 Apr 2014  路  9Comments  路  Source: gulpjs/gulp

Tried different node versions, but doesn't help.
Using latest 3.6.0 gulp.
Running on latest OSX Mavericks.

Strange that on another laptop with Mountain Lion everything works.
I would guess that with such inconsistency it's hard to do something, but maybe someone can give me some tips regarding possible debugging of my situation. Maybe some console.log's would help is some gulp or orchestrator sources?

This is a similar issue:
https://github.com/gulpjs/gulp/issues/18

but in my case I am running as usual

Most helpful comment

Same issue here. My temp fix was:

gulp.task('default', ['build'], function() {
    process.exit(0);
});

All 9 comments

Experiencing this as well w/ 3.6.1

gulpfile.js

var gulp = require('gulp');

gulp.task('browserify', require('./tasks/browserify'));

gulp.task('default', ['browserify']);

tasks/browserify.js

var browserify = require('browserify');
var glob = require('glob');
var gulp = require('gulp');
var source = require('vinyl-source-stream');
var _ = require('lodash');

function mapView (file) {
    var split = file.split('/');
    return {
        path: file,
        alias: split[split.length - 2]
    };
}

function map (file) {
    return {
        path: file,
        alias: file.split('/').pop().replace('.js', '')
    };
}

module.exports = function () {
    // Local modules
    var local = [];

    local = local.concat(
        // Controllers
        _.map(glob.sync(__dirname + '/../controllers/*.js'), map),

        // Views
        _.map(glob.sync(__dirname + '/../views/*/index.js'), mapView),

        // DIY Utils
        _.map(glob.sync(__dirname + '/../lib/diy-util/*.js'), map),

        // General lib
        lib
    );

    var b = browserify();

    b.exclude('lodash');
    b.transform('browserify-shim');

    _.each(local, function (l) {
        b.require(l.path, { expose: l.alias });
    });

    b.bundle()
     .pipe(source('build.js'))
     .pipe(gulp.dest(__dirname + '/../public/js/'))
     .on('error', function (err) { console.error(err); });
};

Having same issue and putting

    "gulp": "3.6.0",
    "vinyl-fs": "0.1.2",

to my package.json solves it.

I also see similar error with #413 so I guess it's because of Gaze.

Interesting the gaze update seems to have broken quite a few things. Also ccing @shama on this

Same issue here. My temp fix was:

gulp.task('default', ['build'], function() {
    process.exit(0);
});

same here. reverting to -
"gulp": "3.6.0"
"gulp-watch": "0.5.4"
fixed it for me. yup gaze broke stuff.

@blopker
are you still using this fix?
gulp.task('default', ['build'], function() {
process.exit(0);
});
it works for me on Jenkins build, but I want to be sure if I can push this code as solved.
do you think I can leave it this way or I there is fix for this?

The fix is to return an async-done compatible value.

    b.bundle()
     .pipe(source('build.js'))
     .pipe(gulp.dest(__dirname + '/../public/js/'))
     .on('error', function (err) { console.error(err); });

should be returned: return b.bundle(). <...>;

Was this page helpful?
0 / 5 - 0 ratings