I
I
Igor2015-09-16 23:47:31
gulp.js
Igor, 2015-09-16 23:47:31

How to fix GULP error - too many open files - EMFILE: too many open files?

Tasks in gulp compile many less files, if you run tasks separately, no errors occur, but I would like to combine all tasks and run them with one command, but I get an error
EMFILE: too many open files,
OC: windows 7 64
NODEJS, GIT, GULP, NPM - latest versions.
And there are 24 such times:

gulp.task('style_1:build', function (){
  gulp.src(path.src.dirstyle + 'style_1.less').pipe(plumber()).pipe(less()).pipe(cssmin()).pipe(gulp.dest(path.build.css));
});
gulp.task('style_2:build', function () {
  gulp.src(path.src.dirstyle + 'style_2.less').pipe(plumber()).pipe(less()).pipe(cssmin()).pipe(gulp.dest(path.build.css));
});

Further we collect in one:
gulp.task('style', [
    'style_1:build',
    'style_2:build',
...........
    'style_24:build'
]);

The conclusion is:
............
[17:10:13] Starting 'style_24:build'...
[17:10:13] Finished 'style_24:build' after 2.33 ms
[17:10:13] Starting 'style'...
[17:10:13] Finished 'style' after 8.6 μs
[17:10:19] Plumber found unhandled error:
 Error in plugin 'gulp-less'
Message:
    EMFILE: too many open files, open '......page.less' in file ......build.less line no. 124

in fact, the files in the output do not have errors in the lines, since everything is compiled separately or, say, if we divide it into two tasks of 12 tasks each, then everything is fine too.
If all 24 tasks are in one, then an error.
Compiled roughly 24 * on all less bootstrap files

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Antonov, 2015-09-17
@undermuz

Attach a file with tasks, so you can’t understand it right off the bat.
I personally have a lot of files on win 10 through npm + gulp compiles - and there is no such error

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question