I'm having the same problem as in this question (the answer doesn't work):
Gulp-connect shows an error 'listen EADDRINUSE' 8080
I'm trying to get the gulp-connect liveReload option to work. The script loads:
Server started http://localhost:8080
[12:01:20] LiveReload started on port 35729
But then when I modify a html file in the project and hit save, I receive this error:
events.js:182
throw er; // Unhandled 'error' event
Error: listen EADDRINUSE :::8080
I have tried changing ports as recommended (both localhost and liveReload) but it doesn't change anything.
Code:
gulp.task('default', ['connect', 'watch'], function () {
browserify({
entries: ['./builds/development/js/main.js'],
debug: true
})
.bundle()
.pipe(source('bundle.js'))
.pipe(gulp.dest('myDestination'));
});
gulp.task('watch', function(){
gulp.watch('myFileSources', ['default']);
});
gulp.task('connect', function(){
connect.server({
root: "myRoot",
port: 8080, // 8081
livereload: true // {port:35730}
});
});
It's simply because your port
8080is already occupied by another running server. Simply change the port with something available like3XXXor9XXX.