node.jsgulpgulp-browser-syncwindows64

GULP [Browsersync] Couldn't open browser


Problem - When I run gulp, this message appears:

[Browsersync] Couldn't open a browser (if you are using BrowserSync in a headless environment, you might want to set the open option to false)

gulpfile.js code:

gulp.task('serve', function() {
  browserSync.init({
    open: 'external',
    proxy: 'site1.net', // baseDir: "./"
    watchTask: true,
    port: 8080,
    browser: "chrome"
  });
});

I have to manually input the URLs into the browser & it worked with my current connections, but the message is still there. So how do I solve this issue? Any help would be highly appreciated, thanks

Screenshots:

http://www.screencast.com/t/rZDYsPLvM1uv

http://www.screencast.com/t/6MMLk5gA

http://www.screencast.com/t/9EoNLhAlK

(note: sorry can't make hyperlink syntax work after many attempts, which is weird.)

History:

I had no issues with my Browser sync before & my gulp runs automatically - not until now. I think I had Windows 10 64bit update today and this issue came out. All seems normal, except the Browser sync Issue.

I tried these links, but nothing seemed to work:

BrowserSync Gulp doesn't open in Chrome

Browser not launching with BrowserSync or live-server


Solution

  • Here is what worked for me:

    running [ 64bit] windows 10

    Node [ v6.12.2 ] Npm [ 3.10.10 ] Gulp [ Local version 3.9.1 ]

    I upgraded my node & npm to:

    Node [ v8.11.3 ] Npm [ 6.2.0 ] Gulp [ Local version 3.9.1 ]

    when I ran "gulp", it suggested to do the ff commands:

          npm rebuild node-sass --force  // somehow node_modules (folder) was deleted
          npm install                    // reinstall node_modules (folder)
          npm audit
          npm audit fix
    

    from here, when I ran "gulp", everything was running smoothly with no issues...

    If somehow nothing works, you could check this from BrowserSync