Installing Bower on your Windows machine

Managing dependencies is one of the hardest job in the life of a web developer. For example, Whenever we installs a new library, we may need to add other libraries which our newly added library depends upon for working correctly. Some times adding incorrect versions also will give undesired results. This problem was solved by package manager applications like NuGet for server side frameworks. 

For client side frameworks, it's even a bigger issue. A web site will normally contain a lot of client side frameworks such as jQuery, AngularJS, MomentJS etc and keeping track of updates and making sure that specific versions are used by libraries is a tedious job. That's where tools like Bower comes in handy

Bower makes sure that it installs the right versions of the packages and dependencies we need. It can manage components that can have   HTML, Javascript, fonts, css, image files etc. What Bower basically does is that searches for the web for the package and dependencies all over the web, downloads and saves it for your use. It creates a file called bower.json  which it uses for tracking the saved ones.

Let's now proceed with installation of Bower. You will need Node.js in the machine as we are using Node Package Manager or npm for installing Bower. If your machine doesn't have one, head over to this post to know more about installing Node.js.

So the command used for installing bower is

npm install -g bower

This statement will install bower globally in your system, meaning it's avaliable for all of the projects you are going create from now.

You can confirm whether bower is installed correctly or not by running the statment below. It will output the help for the bower to the console

bower 

You can also get help on specific command using -help switch. Suppose if we want to more information about the search command, use the one given below.

bower install -help

And the output will be

In the next post, I will show you how to search, install and use a package in your project

Till then, code with passion !!!


No Comments

Add a Comment