Im trying to change from Grunt to Gulp now, and need a static server (gulp-connect doesn't provide a keepalive option, have no Idea why)
But I constantly get this error whenever trying to run the gulp browser-sync task:
[gulp] Using gulpfile C:\Users\Fernando\Projects\renovaintra.template\gulpfile.js
[gulp] Starting 'browser-sync'...
[gulp] Finished 'browser-sync' after 2.81 ms
[BS] Server running. Use this URL: http://192.168.1.102:3002
[BS] Serving files from: C:\Users\Fernando\Projects\renovaintra.template/public/
[BS] Watching files...
events.js:72
throw er; // Unhandled 'error' event
^
Error: This socket is closed.
at Socket._write (net.js:637:19)
at doWrite (_stream_writable.js:226:10)
at writeOrBuffer (_stream_writable.js:216:5)
at Socket.Writable.write (_stream_writable.js:183:11)
at Socket.write (net.js:615:40)
at Socket.Writable.end (_stream_writable.js:341:10)
at Socket.end (net.js:396:31)
at Static.gzip (C:\Users\Fernando\Projects\renovaintra.template\node_modules\browser-sync\node_modules\socket.io\lib\static.js:207:14)
at ready (C:\Users\Fernando\Projects\renovaintra.template\node_modules\browser-sync\node_modules\socket.io\lib\static.js:370:14)
at C:\Users\Fernando\Projects\renovaintra.template\node_modules\browser-sync\node_modules\socket.io\lib\static.js:103:9
And here it is my gulp task:
__location = './public/';
gulp.task('browser-sync', function() {
browserSync.init([__location + '*.html'], {
server: {
baseDir: __location
}
});
});