The published responses are correct but incomplete.
Git to install the packages we first need to make sure git is installed.
$ sudo apt install git-core
Bower uses Node.js and npm to manage the programs so lets install these.
$ sudo apt install nodejs
Node will now be installed with the executable located in /etc/usr/nodejs
.
You should be able to execute Node.js by using the command below, but as ours are location in nodejs we will get an error No such file or directory.
$ /usr/bin/env node
We can manually fix this by creating a symlink.
$ sudo ln -s /usr/bin/nodejs /usr/bin/node
Now check Node.js is installed correctly by using.
$ /usr/bin/env node
>
Some users suggest installing legacy nodejs, this package just creates a symbolic link to binary nodejs.
$ sudo apt install nodejs-legacy
Now, you can install npm and bower
Install npm
$ sudo apt install npm
Install Bower
$ sudo npm install -g bower
Check bower is installed and what version you're running.
$ bower -v
1.8.0
Reference: