I have searched and searched for this, to no avail. I've combed the web (including Stackoverflow), and the Node docs for an answer, and not found one---that worked (maybe that's just bad searching on my part). I'm working with an event-stream in a gulp config file, and I have a particular task that is hitting the classic "memory leak detected" error from the EventEmitter class. From what I've found, the answer to dealing with this issue seems to be to call the setMaxListeners method of the EventEmitter class; and my research has suggested that the event-stream has a Stream object, which should be an instance of EventEmitter. However, what ever way I try to call setMaxListeners, I get method not found. After exhausting myself researching the issue, I figured I'd bring it to the Node gurus here (I'm assuming this is simple, and I'm just missing something). Here's my code:
return eventStream.merge(
gulp.src('./jscript/libs/file-one.js'),
gulp.src('./jscript/libs/filder_one/file-two.js'),
gulp.src('./jscript/libs/folder_two/file-three.js'),
gulp.src('./jscript/libs/folder_three/file_four.js'),
gulp.src('./jscript/libs/folder_four/file_five.js'),
gulp.src('./jscript/libs/folder_five/file_six.js'),
gulp.src('./jscript/libs/file_seven.js'),
gulp.src('./jscript/libs/file_eight.js'),
gulp.src('./jscript/lists/rules/*.js')
)
.pipe(concat('my_file.js'))
.pipe(gulp.dest('./jscript/dist/'))
.pipe(rename('my_file.min.js'))
.pipe(uglify())
.pipe(gulp.dest('./jscript/dist/'));
Thanks!