I'm new to Gulp and BrowserSync, so I've been running gulp and stopping (forced by ctrl + z in terminal) it many times. Every time I start gulp again in terminal, BrowserSync gives me a new PORT number.
I need help removing the old instances of BrowserSync. Is there a command in terminal where I can view and delete old BS instances? Is this even possible? I started BS at port 3001 (Local) and 3002 (UI) and now I'm at 3018! I want to go back to 3001.
Also, how can I fix my Gulpfile.js code so when I force stop gulp in terminal, browserSync exits Local and UI server instances, so the port number doesn't keep increasing?
My BrowserSync portion in Gulpfile.js is very basic:
gulp.task('browser', function () {
// Serve files from root of this folder
browserSync({
server: {
baseDir: './'
}
});
gulp.watch(['html/*.html', 'js/*.js']).on("change", reload);
});
gulp.task('default', ['styles','browser'], function() {
gulp.watch('./sass/**/*.scss', ['styles']);
});
In my mac Terminal, the latest BS instance is at 30018, and UI happens to be at 3021 (because I recently used bs.server.close(), which closes Local instance, but not the UI instance.
[BS] Access URLs:
--------------------------------------
Local: http://localhost:3018
External: http://192.168.1.164:3018
--------------------------------------
UI: http://localhost:3021
UI External: http://192.168.1.164:3021
--------------------------------------
[BS] Serving files from: ./
^Z
[16]+ Stopped gulp