search

Home  >  Q&A  >  body text

Teacher, please tell me how to solve this problem when I open browsersync?

捕获.PNG

lauylauy2651 days ago2120

reply all(1)I'll reply

  • PHP中文网

    PHP中文网2017-09-25 11:57:21

    There is a static page under the demo folder. Use the command line tool in the current directory to start browser-sync through:

    browser-sync start --server --files "css/*.css"

    ;


    var opn = require("opn");
    opn(url, options).catch(function() {
    bs.events.emit("browser:error");
    });

    Source code At: https://github.com/BrowserSyn...

    This error will only be reported when there is an error opening the opn library.

    "browser:error": function () {
    logger.error("Couldn't open browser (if you are using BrowserSync in a headless environment, you might want to set the {cyan:open} option to {cyan: false})");
    },

    The source code is at: https://github.com/BrowserSyn...

    My suggestion is to clean the cache, reinstall dependencies, and upgrade the version.

    If the error is reported again, set the open switch of BrowserSync to false and try again.

    reply
    0
  • Cancelreply