{"componentChunkName":"component---src-pages-markdown-remark-fields-slug-js","path":"/engineering/how-to-use-bower-to-install-bootstrap/","result":{"data":{"markdownRemark":{"id":"55058f5f-dc61-5f1d-8298-748b1e94398f","excerpt":"Bower is a popular package manager to help you quickly deploy components. In this article I'm going to show you how to install Bower and how to use it to…","html":"<p>Bower is a popular package manager to help you quickly deploy components. In this article I'm going to show you how to install Bower and how to use it to install Bootstrap.</p>\n<p>Pre-requisites: To install Bower you must first have Node.js and npm (another package manager) installed, your computer may have shipped with these pre-installed. To check if you have npm, open your command-line tool and type:</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"shell\" data-index=\"0\"><code class=\"grvsc-code\"><span class=\"grvsc-line\">npm -v</span></code></pre>\n<p>If you do not get a version number, you may need to install npm which comes pre-packaged with Node.js</p>\n<p>You can find Node.js along with instructions on how-to install it here: <a href=\"https://nodejs.org/en/\">NodeJS</a></p>\n<p><strong>Windows Users Only</strong>: If you're a Windows user make sure you have Git for Windows installed to work with the Windows Command Prompt with Checkout Windows-Style and commit Unix-style line endings. You can find more information on that here: <a href=\"https://git-for-windows.github.io\">Git for Windows</a></p>\n<h2 id=\"installation\" style=\"position:relative;\"><a href=\"#installation\" aria-label=\"installation permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Installation:</h2>\n<p>Provided that you have both Node.js and npm installed, run the following command in your Command-line tool:</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"shell\" data-index=\"1\"><code class=\"grvsc-code\"><span class=\"grvsc-line\">npm install -g bower</span></code></pre>\n<h2 id=\"usage\" style=\"position:relative;\"><a href=\"#usage\" aria-label=\"usage permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Usage:</h2>\n<p>Once Bower is installed it's as easy as going to your project folder in Command-line and typing:</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"shell\" data-index=\"2\"><code class=\"grvsc-code\"><span class=\"grvsc-line\">bower install bootstrap</span></code></pre>\n<p>followed by:</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"shell\" data-index=\"3\"><code class=\"grvsc-code\"><span class=\"grvsc-line\">bower install jquery</span></code></pre>\n<p>This will install the files required for Bootstrap in the newly created 'bower_components' folder.</p>\n<p>In this folder you will have 2 new folders 'bootstrap' and 'jquery'.</p>\n<p>The next step is to include the files for both jQuery and Bootstrap into your project file(s).</p>\n<p>...And that's it, you're good to go.</p>\n<h2 id=\"updating\" style=\"position:relative;\"><a href=\"#updating\" aria-label=\"updating permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Updating</h2>\n<p>If you need to update a project and are unsure which bower packages you have installed that might need an update, you can type</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"shell\" data-index=\"4\"><code class=\"grvsc-code\"><span class=\"grvsc-line\">bower list</span></code></pre>\n<p>in your project directory for a listing of packages you installed via Bower and which ones are due for an update.</p>\n<p>in this case if we wanted to update our bootstrap install we would do:</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"shell\" data-index=\"5\"><code class=\"grvsc-code\"><span class=\"grvsc-line\">bower update bootstrap</span></code></pre>\n<h2 id=\"making-your-bower-configurations-portable\" style=\"position:relative;\"><a href=\"#making-your-bower-configurations-portable\" aria-label=\"making your bower configurations portable permalink\" class=\"anchor before\"><svg aria-hidden=\"true\" focusable=\"false\" height=\"16\" version=\"1.1\" viewBox=\"0 0 16 16\" width=\"16\"><path fill-rule=\"evenodd\" d=\"M4 9h1v1H4c-1.5 0-3-1.69-3-3.5S2.55 3 4 3h4c1.45 0 3 1.69 3 3.5 0 1.41-.91 2.72-2 3.25V8.59c.58-.45 1-1.27 1-2.09C10 5.22 8.98 4 8 4H4c-.98 0-2 1.22-2 2.5S3 9 4 9zm9-3h-1v1h1c1 0 2 1.22 2 2.5S13.98 12 13 12H9c-.98 0-2-1.22-2-2.5 0-.83.42-1.64 1-2.09V6.25c-1.09.53-2 1.84-2 3.25C6 11.31 7.55 13 9 13h4c1.45 0 3-1.69 3-3.5S14.5 6 13 6z\"></path></svg></a>Making your Bower configurations portable</h2>\n<p>Once you have figured out your configurations and installed all of your desired Bower packages you can use:</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"shell\" data-index=\"6\"><code class=\"grvsc-code\"><span class=\"grvsc-line\">bower init</span></code></pre>\n<p>Follow the steps provided in your Command-line.</p>\n<p>This will initialize a bower.json file which will store your configurations.</p>\n<p>Once you have your Bower.json file you can move it around to other locations or projects and you can get Bower to reinstall all of your packages and configurations by typing:</p>\n<pre class=\"grvsc-container dark-default-dark\" data-language=\"shell\" data-index=\"7\"><code class=\"grvsc-code\"><span class=\"grvsc-line\">bower install</span></code></pre>\n<p>This will get Bower to create another 'bower_components' folder with the same packages and configurations specified in your bower.json file.</p>\n<p>For further information on using or configuring Bower <a href=\"https://bower.io/\">You can checkout the official website</a></p>\n<style class=\"grvsc-styles\">\n  .grvsc-container {\n    overflow: auto;\n    -webkit-overflow-scrolling: touch;\n    padding-top: 1rem;\n    padding-top: var(--grvsc-padding-top, var(--grvsc-padding-v, 1rem));\n    padding-bottom: 1rem;\n    padding-bottom: var(--grvsc-padding-bottom, var(--grvsc-padding-v, 1rem));\n    border-radius: 8px;\n    border-radius: var(--grvsc-border-radius, 8px);\n    font-feature-settings: normal;\n  }\n  \n  .grvsc-code {\n    display: inline-block;\n    min-width: 100%;\n  }\n  \n  .grvsc-line {\n    display: inline-block;\n    box-sizing: border-box;\n    width: 100%;\n    padding-left: 1.5rem;\n    padding-left: var(--grvsc-padding-left, var(--grvsc-padding-h, 1.5rem));\n    padding-right: 1.5rem;\n    padding-right: var(--grvsc-padding-right, var(--grvsc-padding-h, 1.5rem));\n  }\n  \n  .grvsc-line-highlighted {\n    background-color: var(--grvsc-line-highlighted-background-color, transparent);\n    box-shadow: inset var(--grvsc-line-highlighted-border-width, 4px) 0 0 0 var(--grvsc-line-highlighted-border-color, transparent);\n  }\n  \n  .dark-default-dark {\n    background-color: #1E1E1E;\n    color: #D4D4D4;\n  }\n</style>","headings":[{"value":"Installation:","depth":2},{"value":"Usage:","depth":2},{"value":"Updating","depth":2},{"value":"Making your Bower configurations portable","depth":2}],"fields":{"slug":"/engineering/how-to-use-bower-to-install-bootstrap/"},"frontmatter":{"metatitle":null,"metadescription":null,"description":"Learn how the Bower package manager helps into quick components  deploy and install Bootstrap using Bower","title":"Install Bootstrap with Bower","canonical":null,"date":"July 05, 2017","updated_date":null,"tags":["Bootstrap","Bower"],"coverImage":{"childImageSharp":{"fluid":{"aspectRatio":1.1363636363636365,"src":"/static/f22ed4623c0a1e31c973ed6e1f0ba4bd/03979/bower-logo.png","srcSet":"/static/f22ed4623c0a1e31c973ed6e1f0ba4bd/f5f11/bower-logo.png 200w,\n/static/f22ed4623c0a1e31c973ed6e1f0ba4bd/6d133/bower-logo.png 400w,\n/static/f22ed4623c0a1e31c973ed6e1f0ba4bd/03979/bower-logo.png 800w,\n/static/f22ed4623c0a1e31c973ed6e1f0ba4bd/5825a/bower-logo.png 1024w","sizes":"(max-width: 800px) 100vw, 800px"}}},"author":{"id":"Pascal Noel","github":null,"bio":"Software Engineer and adventure seeker with a knack for fun facts. Originally from the East Coast of Canada, moved to Vancouver to enjoy its mild climate and now staying for its scenic hikes.","avatar":null}}}},"pageContext":{"id":"55058f5f-dc61-5f1d-8298-748b1e94398f","fields__slug":"/engineering/how-to-use-bower-to-install-bootstrap/","__params":{"fields__slug":"engineering"}}},"staticQueryHashes":["1171199041","1384082988","1711371485","1753898100","2100481360","229320306","23180105","528864852"]}