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?
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?
You need to create a symlink because the npm installer doesn't do it.
ln -s /usr/bin/nodejs /usr/bin/node
Its documented here: https://nodejs.org/en/download/package-manager/
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:
nodejs-legacy
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
2.10.1
Thanks to @Biffen for his tip :)
I had a similar issue which I resolved by removing the problematic existing broken symlink and creating a new one:
Hope it helps someone, Cheers