I use browser-sync in Bash, it doesn't auto-open browser and says [BS] Couldn't open browser (if you are using BrowserSync in a headless environment, you might want to set the open option to false)
when I type npm start
in Angular example.
Of course there's no option to open a browser in limited Linux environment (since no GUI support provided in Bash on Ubuntu on Windows).
If I use Powershell, it's working OK.
My environment: VS Code + Bash on Ubuntu on Windows.
But is there a config or workaround?
So while I kept browsing, i found a clue to the solution of this problem on this webpage https://gist.github.com/Kenty/9096000/revisions which hinted me of where i could find the open option from the error message. I decided to searched for "bs.config.js" on my pc and i found a file called default.config.js in my \Template\node_modules\browser-sync\lib folder under my angular folder and when i searched through the file, i finally found the open option and changed the open option from "local" (which is the default option) to false (Note, it's without the quotes) and when i ran the npm start command again, on the git-bash terminal It worked and there were no more errors.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With