install

install

$ bower install [<options>]
$ bower install <endpoint> [<endpoint> ..] [<options>]

Installs project dependencies recursively.

Project dependencies consist of:

  1. dependencies specified in bower.json of project
  2. All “external” dependencies not specified in bower.json, but present in bower_components
  3. Any additional <endpoint> passed as an argument to this command

When --save flag is used, all additional endpoint are saved to dependencies in bower.json.

Bower recommends to always use --save flag to achieve reproducible installs between machines.

Endpoints can have multiple forms:

  • <package>
  • <package>#<version>
  • <name>=<package>#<version>

Where:

  • <package> is a package URL, physical location or registry name
  • <version> is a valid range, commit, branch, etc.
  • <name> is the name it should have locally.

<package> can be any one of the following:

Registered package name jquery
normalize.css
Git endpoint https://github.com/user/package.git
git@github.com:user/package.git
Git endpoint without .git git+https://github.com/user/package
git+ssh://git@github.com/user/package
Local folder my/local/folder/
Public Subversion endpoint svn+http://package.googlecode.com/svn/
Private Subversion endpoint svn+ssh://package.googlecode.com/svn/
svn+https://package.googlecode.com/svn/
Shorthand (defaults to GitHub) user/package
URL http://example.com/script.js
http://example.com/style.css
http://example.com/package.zip (contents will be extracted)
http://example.com/package.tar (contents will be extracted)

A version can be:

semver version #1.2.3
version range #1.2
#~1.2.3
#^1.2.3
#>=1.2.3 <2.0
Git tag #<tag>
Git commit SHA #<sha>
Git branch #<branch>
Subversion revision #<revision>

install options

  • -F, --force-latest: Force latest version on conflict
  • -p, --production: Do not install project devDependencies
  • -S, --save: Save installed packages into the project’s bower.json dependencies
  • -D, --save-dev: Save installed packages into the project’s bower.json devDependencies
  • -E, --save-exact: Configure installed packages with an exact version rather than semver
doc_Bower
2016-04-20 16:18:20
Comments
Leave a Comment

Please login to continue.