0
votes

I just installed browser-sync but when I try to start a server I get this error:

      terkea@terkea-Lenovo-G50-80:~$ browser-sync start --server --files index.html[Browsersync] Access URLs:

   Local: http://localhost:3000
External: http://192.168.1.3:3000
------------------------------------
      UI: http://localhost:3001
UI External: http://192.168.1.3:3001
------------------------------------

[Browsersync] Serving files from: ./ [Browsersync] Watching files...

Maybe someone could find what's wrong and help me please?

2
What is the error?Nico Haase
when i open the browser i get CANNOT GET/ instead of my index.phpTerchila Marian
I don't get that, and please add the error to your question instead of commenting itNico Haase
did u ever use browser-sync?Terchila Marian
Yes, I did. But I do not get what you did to provoke the error.Nico Haase

2 Answers

0
votes

You probably need to pass an argument to --server which is the directory from which you want to serve the files from. Browser-sync uses your current working directory by default.

So for example, if you're starting browser-sync in the root directory of your project, and your index.html is in folder a/b/c/index.html, then the browser-sync command will be:

browser-sync start --server "a/b/c/" --files "index.html"
0
votes

You must specify the folder in which your files are located. I use ubuntu 18.04 and it works. For example, if you want to open all files in directory /home/user/code you must write this command:

browser-sync start --server "/home/user/code/" --files "*.*"