Ihab Abdel-Rahim Ihab Abdel-Rahim - 1 year ago 76
Node.js Question

Browsersync on Linux

I did install Browsersync on Ubuntu using command line:

npm install -g browser-sync

Now, I went to check for version:

browser-sync --version

where I get error message:

/usr/bin/env: node: No such file or directory

What should I do now?

Answer Source

I got it fixed installing nodejs-legacy:

sudo apt-get install nodejs-legacy

Then checked back to be worked:

ihab@ihab-pc:~$ node --version
The program 'node' can be found in the following packages:
 * node
 * nodejs-legacy
Try: sudo apt-get install <selected package>
ihab@ihab-pc:~$ sudo apt-get install nodejs-legacy
[sudo] password for ihab: 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
The following NEW packages will be installed:
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 14.6 kB of archives.
After this operation, 122 kB of additional disk space will be used.
Get:1 http://eg.archive.ubuntu.com/ubuntu/ wily/universe nodejs-legacy all 0.10.25~dfsg2-2ubuntu1 [14.6 kB]
Fetched 14.6 kB in 0s (32.9 kB/s)      
Selecting previously unselected package nodejs-legacy.
(Reading database ... 232447 files and directories currently installed.)
Preparing to unpack .../nodejs-legacy_0.10.25~dfsg2-2ubuntu1_all.deb ...
Unpacking nodejs-legacy (0.10.25~dfsg2-2ubuntu1) ...
Processing triggers for man-db (2.7.4-1) ...
Setting up nodejs-legacy (0.10.25~dfsg2-2ubuntu1) ...
ihab@ihab-pc:~$ browser-sync --version

Thanks to @Biffen for his tip :)