1 | # Bower - A package manager for the web
|
2 |
|
3 | > Bower needs resources for its maintenance. Please fill [this form](https://docs.google.com/forms/d/1i-Opb-uPdqUBBZQSbngv3Y3bfolG1gbBvtRLfxMnzRE/viewform?c=0&w=1) if you think you can help.
|
4 |
|
5 | [![Build Status](https://travis-ci.org/bower/bower.svg?branch=master)](https://travis-ci.org/bower/bower)
|
6 | [![Windows Build](https://ci.appveyor.com/api/projects/status/jr6vfra8w84plh2g/branch/master?svg=true)](https://ci.appveyor.com/project/sheerun/bower/history)
|
7 | [![Coverage Status](https://img.shields.io/coveralls/bower/bower.svg)](https://coveralls.io/r/bower/bower?branch=master)
|
8 | [![Discord chat](https://img.shields.io/badge/discord-join%20chat%20%E2%86%92-brightgreen.svg?style=flat)](https://discord.gg/0fFM7QF0KpZRh2cY)
|
9 | [![Issue Stats](http://issuestats.com/github/bower/bower/badge/pr?style=flat)](http://issuestats.com/github/bower/bower)
|
10 | [![Issue Stats](http://issuestats.com/github/bower/bower/badge/issue?style=flat)](http://issuestats.com/github/bower/bower)
|
11 |
|
12 | <img align="right" height="300" src="http://bower.io/img/bower-logo.png">
|
13 |
|
14 | ---
|
15 |
|
16 | Bower offers a generic, unopinionated solution to the problem of **front-end package management**, while exposing the package dependency model via an API that can be consumed by a more opinionated build stack. There are no system wide dependencies, no dependencies are shared between different apps, and the dependency tree is flat.
|
17 |
|
18 | Bower runs over Git, and is package-agnostic. A packaged component can be made up of any type of asset, and use any type of transport (e.g., AMD, CommonJS, etc.).
|
19 |
|
20 | **View complete docs on [bower.io](http://bower.io)**
|
21 |
|
22 | [View all packages available through Bower's registry](http://bower.io/search/).
|
23 |
|
24 | ## Install
|
25 |
|
26 | ```sh
|
27 | $ npm install -g bower
|
28 | ```
|
29 |
|
30 | Bower depends on [Node.js](http://nodejs.org/) and [npm](http://npmjs.org/). Also make sure that [git](http://git-scm.com/) is installed as some bower
|
31 | packages require it to be fetched and installed.
|
32 |
|
33 |
|
34 | ## Usage
|
35 |
|
36 | See complete command line reference at [bower.io/docs/api/](http://bower.io/docs/api/)
|
37 |
|
38 | ### Installing packages and dependencies
|
39 |
|
40 | ```sh
|
41 | # install dependencies listed in bower.json
|
42 | $ bower install
|
43 |
|
44 | # install a package and add it to bower.json
|
45 | $ bower install <package> --save
|
46 |
|
47 | # install specific version of a package and add it to bower.json
|
48 | $ bower install <package>#<version> --save
|
49 | ```
|
50 |
|
51 | ### Using packages
|
52 |
|
53 | We discourage using bower components statically for performance and security reasons (if component has an `upload.php` file that is not ignored, that can be easily exploited to do malicious stuff).
|
54 |
|
55 | The best approach is to process components installed by bower with build tool (like [Grunt](http://gruntjs.com/) or [gulp](http://gulpjs.com/)), and serve them concatenated or using a module loader (like [RequireJS](http://requirejs.org/)).
|
56 |
|
57 | ### Uninstalling packages
|
58 |
|
59 | To uninstall a locally installed package:
|
60 |
|
61 | ```sh
|
62 | $ bower uninstall <package-name>
|
63 | ```
|
64 |
|
65 | ### prezto and oh-my-zsh users
|
66 |
|
67 | On `prezto` or `oh-my-zsh`, do not forget to `alias bower='noglob bower'` or `bower install jquery\#1.9.1`
|
68 |
|
69 | ### Never run Bower with sudo
|
70 |
|
71 | Bower is a user command; there is no need to execute it with superuser permissions.
|
72 |
|
73 | ### Windows users
|
74 |
|
75 | To use Bower on Windows, you must install
|
76 | [Git for Windows](http://git-for-windows.github.io/) correctly. Be sure to check the
|
77 | options shown below:
|
78 |
|
79 | <img src="https://cloud.githubusercontent.com/assets/10702007/10532690/d2e8991a-7386-11e5-9a57-613c7f92e84e.png" width="534" height="418" alt="Git for Windows" />
|
80 |
|
81 | <img src="https://cloud.githubusercontent.com/assets/10702007/10532694/dbe8857a-7386-11e5-9bd0-367e97644403.png" width="534" height="418" alt="Git for Windows" />
|
82 |
|
83 | Note that if you use TortoiseGit and if Bower keeps asking for your SSH
|
84 | password, you should add the following environment variable: `GIT_SSH -
|
85 | C:\Program Files\TortoiseGit\bin\TortoisePlink.exe`. Adjust the `TortoisePlink`
|
86 | path if needed.
|
87 |
|
88 | ### Ubuntu users
|
89 |
|
90 | To use Bower on Ubuntu, you might need to link `nodejs` executable to `node`:
|
91 |
|
92 | ```
|
93 | sudo ln -s /usr/bin/nodejs /usr/bin/node
|
94 | ```
|
95 |
|
96 | ## Configuration
|
97 |
|
98 | Bower can be configured using JSON in a `.bowerrc` file. Read over available options at [bower.io/docs/config](http://bower.io/docs/config).
|
99 |
|
100 |
|
101 | ## Support
|
102 |
|
103 | * [Discord chat](https://discord.gg/0fFM7QF0KpZRh2cY)
|
104 | * [StackOverflow](http://stackoverflow.com/questions/tagged/bower)
|
105 | * [Mailinglist](http://groups.google.com/group/twitter-bower) - twitter-bower@googlegroups.com
|
106 |
|
107 | ## Contributing
|
108 |
|
109 | We welcome [contributions](https://github.com/bower/bower/graphs/contributors) of all kinds from anyone. Please take a moment to review the [guidelines for contributing](CONTRIBUTING.md).
|
110 |
|
111 | * [Bug reports](https://github.com/bower/bower/wiki/Report-a-Bug)
|
112 | * [Feature requests](CONTRIBUTING.md#features)
|
113 | * [Pull requests](CONTRIBUTING.md#pull-requests)
|
114 |
|
115 |
|
116 | Note that on Windows for tests to pass you need to configure Git before cloning:
|
117 |
|
118 | ```
|
119 | git config --global core.autocrlf input
|
120 | ```
|
121 |
|
122 | ## License
|
123 |
|
124 | Copyright (c) 2016 Twitter and [other contributors](https://github.com/bower/bower/graphs/contributors)
|
125 |
|
126 | Licensed under the MIT License
|