-2

I am running a nodejs frontend-only website that uses lite-server. as I am trying to deploy it with git in CLI, it shows me the error:

Did not detect a bs-config.json or bs-config.js override file. Using lite-server defaults...Couldn't open a browser (if you are using BrowserSync in a headless environment, you might want to set the open option to false)

Any thoughts on this?

aliyousefian
  • 449
  • 5
  • 14
Babatunde Mustapha
  • 2,131
  • 20
  • 21
  • Why are you using `lite-server` in the backend? Use express to serve all the static files! See [Serving Static Files with Express](https://expressjs.com/en/resources/middleware/serve-static.html) – h-sifat Jan 01 '22 at 14:54
  • The error message exactly describes what you have to do, doesn't it? Hence, this question doesn't show any research effort. – Thomas Sablik Feb 12 '22 at 12:49

1 Answers1

0

You are seeing this error because you are running your project in the headless environment and lite-server uses BrowserSync and its default behavior is to open the browser. However, It allows for configuration overrides via a local bs-config.json or bs-config.js file in your project. You can prevent the browser from opening by setting option open to false in the gulpfule.js file.

open: false

for more information refer to https://www.npmjs.com/package/lite-server

  • 1
    Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Jan 02 '22 at 00:24