Bower is a package manager for the web and offers a generic solution to the problem of front-end package management. For example the Polymer library uses Bower for package management. In fact, the primary reason for me to install Bower was to use Polymer. The main difference between Bower and pther package managers is that Bower will manage any packages, even if that means HTML, CSS, or images. In this case, a package means any third-party code, usually publicly accessible from a Git repository.
Bower depends on Node and npm so first you will need to install NodeJS. For Ubuntu 13.10 and 14.04 and above, 0.10.X versions of Node are present.
sudo apt-get install nodejs
Then install npm.
sudo apt-get install npm
Bower also requires git to be installed as some bower packages require it to be fetched and installed. On my Ubuntu 14.04 LTS, git was installed by default, so no messing around there.
Next install Bower.
sudo npm install -g bower
Now run Bower. Note that some Linux distributions install nodejs not as “node” executable but as “nodejs”. This can throw the following error when running Bower.
/usr/bin/env: node: No such file or directory
This caused some wasted time, however some searching around found a fix. In this case you can do an easy symlink. For Linux distributions which install package binaries to /usr/bin you can do the following.
ln -s /usr/bin/nodejs /usr/bin/node
Some users suggest installing legacy nodejs, this package just creates a symbolic link to binary nodejs.
sudo apt-get install nodejs-legacy
Now that everything is installed, check to see if Bower is correctly working. Lets check Bower version.
bower -version 1.3.3