Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

BrowserSync : Command not found after installing browser-sync

There was another issue open with the same title which has been closed but my error could not be resolved using the solutions given in that issue.

  • Mac OSX El Capitan
  • Node [v5.6.0]
  • Npm [v3.6.0]

I installed Browser-Sync successfully using : bash $ sudo npm install -g browser-sync

but when I check the browser-sync version by typing : bash $ browser-sync --version

I get this error : bash -bash: browser-sync: command not found

like image 962
Faheem Hassan Zunjani Avatar asked Feb 19 '16 07:02

Faheem Hassan Zunjani


People also ask

What is Browsersync Javascript?

BrowserSync makes your tweaking and testing faster by syncronising file changes and interactions across multiple devices.


2 Answers

None of this was helpful to me, instead what I did was find the file location of browser sync after i executed the browser-sync download command supplied on their website. npm install -g browser-sync

Turns out my windows 10 put that downloaded file into %appdata% folder which is in Local Disk (C), but it's an invisible folder and not the correct place it should be, it needs to be in the nodejs folder inside Program Files...

So to find this folder do this: in the search bar of windows 10 type in %appdata% and press Enter, it should open up that hidden folder...

Then click on npm > npm_modules > then you should see files saying browser-sync. Highlight and drag all those files into Local Disk (C) > Program Files > nodejs. You will get allow access prompts, just allow all those.

Now browser-sync and nodejs are sitting happily together and NOW, you can go back to your CMD window and type in browser-sync --version and get the correct version.

I am taking the Coursera class titled HTMl, CSS, and Javascript for Web Developers and ran into this very problem and this solution made it possible for me to continue setting up my environment to take the class.

like image 79
BiscuitGoob Avatar answered Sep 18 '22 13:09

BiscuitGoob


Check where npm installs it's binaries by running npm bin -g, and then add that to your PATH.

export PATH=$PATH:/usr/local/bin
like image 26
bolav Avatar answered Sep 16 '22 13:09

bolav