GithubHelp home page GithubHelp logo

bower's Introduction

Bower - A package manager for the web

Build Backers on Open Collective Sponsors on Open Collective

..psst! While Bower is maintained, we recommend yarn and webpack or parcel for new front-end projects!


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.

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.).

View complete docs on bower.io

View all packages available through Bower's registry.

Install

$ npm install -g bower

Bower depends on Node.js and npm. Also make sure that git is installed as some bower packages require it to be fetched and installed.

Usage

See complete command line reference at bower.io/docs/api/

Installing packages and dependencies

# install dependencies listed in bower.json
$ bower install

# install a package and add it to bower.json
$ bower install <package> --save

# install specific version of a package and add it to bower.json
$ bower install <package>#<version> --save

Using packages

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).

The best approach is to process components installed by bower with build tool (like Grunt or gulp), and serve them concatenated or using a module loader (like RequireJS).

Uninstalling packages

To uninstall a locally installed package:

$ bower uninstall <package-name>

prezto and oh-my-zsh users

On prezto or oh-my-zsh, do not forget to alias bower='noglob bower' or bower install jquery\#1.9.1

Never run Bower with sudo

Bower is a user command; there is no need to execute it with superuser permissions.

Windows users

To use Bower on Windows, you must install Git for Windows correctly. Be sure to check the options shown below:

Git for Windows

Git for Windows

Note that if you use TortoiseGit and if Bower keeps asking for your SSH password, you should add the following environment variable: GIT_SSH - C:\Program Files\TortoiseGit\bin\TortoisePlink.exe. Adjust the TortoisePlink path if needed.

Ubuntu users

To use Bower on Ubuntu, you might need to link nodejs executable to node:

sudo ln -s /usr/bin/nodejs /usr/bin/node

Configuration

Bower can be configured using JSON in a .bowerrc file. Read over available options at bower.io/docs/config.

Support

You can ask questions on following channels in order:

Contributing

We welcome contributions of all kinds from anyone. Please take a moment to review the guidelines for contributing.

Note that on Windows for tests to pass you need to configure Git before cloning:

git config --global core.autocrlf input

Backers

Support us with a monthly donation and help us continue our activities. [Become a backer]

License

Copyright (c) 2012-present Twitter and other contributors

Licensed under the MIT License

bower's People

Contributors

benmann avatar benschwarz avatar contolini avatar dependabot[bot] avatar desandro avatar faceleg avatar fat avatar gregberge avatar gronke avatar josh avatar karthikdot avatar kunyan avatar manasjayanth avatar marcooliveira avatar mklabs avatar necolas avatar nnnnathann avatar nwinkler avatar paulirish avatar paulohp avatar pertrai1 avatar rayshan avatar richo avatar satazor avatar sheerun avatar sindresorhus avatar svnlto avatar uzquiano avatar vladikoff avatar wibblymat avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

bower's Issues

stricter register rules

A pre-register check should do the following:

  • confirm that name is not already in the registry (done)
  • confirm all the dependencies in the json resolve
  • confirm all the resolved child dependencies also resolve
  • all those deps have valid manifests

Anything else?

We want to avoid packages being registered that have faulty dependencies. d3 is an example here.

cc @iros

Component.json appears to be ignored.

This was under #40 - but my comment was incorrectly dismissed.

To be clear, this is not the Mocha repo in the directory (the official Mocha home at https://github.com/visionmedia/mocha). This a repo I created specifically for housing the Mocha bits for Bower. This repo lives at https://github.com/Iristyle/bower-mocha

This repo has a tag for 1.4.2 and component.json is as follows

{
  "name": "Mocha",
  "version": "1.4.2",
  "main": ["./mocha.js", "./mocha.css"],
  "dependencies": {
  }
}

Based on the above, I would only expect mocha.js, mocha.css and component.json copied to my components directory. But I'm also getting Readme.md and LICENSE.

± bower install git://github.com/Iristyle/bower-mocha.git#1.4.2
bower cloning git://github.com/Iristyle/bower-mocha.git
bower caching git://github.com/Iristyle/bower-mocha.git
bower fetching bower-mocha
bower checking out bower-mocha#1.4.2
bower copying C:\Users\EPS\AppData\Roaming\bower-cache\bower-mocha
eps@epshq-devimage: C:\s\AngularCoffeeLessDemo [Grunt +3 ~2 -0 | +0 ~5 -0]        ▶▶▶▶▶▶▶▶▶▶

± ls .\components\Mocha


    Directory: C:\source\AngularCoffeeLessDemo\components\Mocha


Mode                LastWriteTime     Length Name
----                -------------     ------ ----
-a---         9/16/2012   4:15 PM       1020 component.json
-a---         9/16/2012   4:15 PM       1103 LICENSE
-a---         9/16/2012   4:15 PM       2964 mocha.css
-a---         9/16/2012   4:15 PM      93154 mocha.js
-a---         9/16/2012   4:15 PM        550 README.md

Support multiple components per one repo

For AngularJS we keep all of our build artifacts for all versions in a single repo: https://github.com/angular/code.angularjs.org

Each of our releases contains several modules / build artifacts, so there is quite a few files in there. It would be great if I could reuse this repo for bower. I really don't want to create 8+ repos and have a continuous maintenance overhead to keep everything up to date with every release.

bower install doesn't recognize tag for ember.js

Reading bower help install you should be able to do something like bower install <pkg>#<version>. I can't get this to work with the ember.js repository:

$ bower install 'ember#v1.0.pre'
bower cloning git://github.com/emberjs/ember.js.git
bower cached git://github.com/emberjs/ember.js.git
bower fetching ember
bower error Can not find tag: ember#v1.0.pre
bower install 'git://github.com/emberjs/ember.js.git#v1.0.pre'
bower cloning git://github.com/emberjs/ember.js.git
bower cached git://github.com/emberjs/ember.js.git
bower fetching ember.js
bower error Can not find tag: ember.js#v1.0.pre
$ git clone git://github.com/emberjs/ember.js.git
Cloning into 'ember.js'...
 .... 
$ cd ember.js/
$ git tag | grep pre
v1.0.pre

Registration notice doesn't play well with terminal colors

After registering a package, you see something like this:

registered normalize-css to git://github.com/necolas/normalize.css.git

...except in my terminal (iTerm 2) and color scheme (Solarized Dark) the git endpoint is invisible (same color as the background).

Inline versioning for `bower install`

For npm you can do npm install express@3 or npm install express@2. Would be nice if you could something similar for bower, specifically for repos whose working branch is master (instead of a wip branch like Twitter Bootstrap) but have tags for releases.

bower install package not working execvp(): No such file or directory

$ bower install angular
bower cloning git://github.com/angular/bower-angular.git
execvp(): No such file or directory

bower caching git://github.com/angular/bower-angular.git
bower error Git status: 127

Everything else seems to work fine. I having a feeling something got installed wrong or needs a permission. This work fine on another environment i setup.

this is on a Mac OSX 10.7.4, i just installed node and everything 4 days ago so i think everything is the latest version. There is not .bower folder in ~ directory if that helps.

Git status: 128

Hey guys,
just registered a new package a few minutes ago.
When i want to install it, i'm getting an error "Git status: 128"

The package is 'underscore.string':
git://github.com/epeli/underscore.string.git

The solution in issue #32 doesn't work for me.

Could you help with this?
Thanks in advance!

Typo in readme

"and is useful for locking down a project dependencies." should be "a projects' dependencies"...

Meta data about globals (e.g. for AMD/CJS)

Did anyone consider that having bower list --map is not enough data to automagically configure bower components as AMD modules. The thing that's missing is the information about globals that the library exports.

The only way I can see this being done right now is by maintaining a separate registry of this data, which might not be a bad idea (is anyone working on this already?) Hm, https://github.com/volojs/repos comes to mind. It surely would be nice to be able to add this type of metadata to component.json. At least I would be less grumpy about bower not embracing AMD..

Then again.. if the lib doesn't implement AMD, it's likely the authors won't care about describing library's globals. But maybe it could turn into a good practise. With this meta data, you would be able to convert any JS file to a AMD/CJS module. Wouldn't that make the world a better place.

Not sure what one would do if a library exports multiple globals.

Would it be possible to reliably figure out the exports of an old school lib by just analysing the code and looking for when window.global assignment happens?

component.json being discarded?

I'm confused as to which component.json file actually gets used

components/handlebars.js
repo's component.json

{
  "name": "handlebars.js",
  "version": "1.0.0.beta.6",
  "main": ["handlebars-1.0.0.beta.6.js", "handlebars.runtime-1.0.0.beta.6.js"],
  "dependencies": {}
}

register

bower register test-handlebars git://github.com/components/handlebars.js.git
bower install test-handlebars

contents of ./components/test-handlebars/component.json

{
  "repository": {
    "type": "git",
    "url": "git://github.com/components/handlebars.js.git"
  }
}

Why is the repo's component.json being discarded?

CDN field in component.json

It would be nice to be able to specify an alternative CDN URL for some libraries (such as jQuery). For instance:

{
  "name"        : "jquery",
  "version"     : "1.8.1",
  "main"        : "./jquery.js",
  "cdn"         : "//ajax.googleapis.com/ajax/libs/jquery/1.8.1/jquery.min.js",
  "dependencies": {
  }
}

Then build processes consuming these component.json files can choose to use the CDN if they wish. Encouraging this practice means more cached libraries, which is potentially a big win for everyone.

Git tags are ignored for dependencies

I assumed that the Git urls are handled the same way as NPM (maybe that was my mistake) with respect to commit-ish and url dependencies.

For instance, assume I wanted 2.6.1 of modernizr

{
  "name": "ClientSide Dependencies",
  "version": "1.0.0",
  "main": "",
  "dependencies": {
    "modernizr" : "git+https://github.com/Modernizr/Modernizr.git#v2.6.1"
  }
}
.node_modules/.bin/bower install

Everything goes according to plan.. except when I look in my components folder, I actually end up with 2.6.2, the latest tag.

better document main property + stricter rules

discussed a bit here: components/jquery#1

I think if passing an array to the main property, it should only accept 1 file per ext type. thoughts about adding console.warn and providing stricter definition around this.

Also, does it make sense to create a more explicit "component.json" spec?

Registered Package Naming

The following does not help to discourage squatting:

bower register myawesomepackagename git://github.com/maccmans/face

However, the following would help:

bower register maccmans/face git://github.com/maccmans/face

I would encourage that if there must be a registry, that it at least put in place some guidelines to prevent issues going forward.

SEE: Why Github style namespacing?

<FATAL> jsdom not found </FATAL>

Redirecting issue from yeoman/yeoman#388

When trying to install d3, i get a "jsdom not found error"

gramercy:spiders dario$ yeoman install d3
Running "bower:install:d3" (bower) task
bower cloning git://github.com/mbostock/d3.git
bower cached git://github.com/mbostock/d3.git
bower fetching d3
bower checking out d3#v2.10.1
bower copying /Users/dario/.bower/d3
<FATAL> jsdom not found </FATAL>

I've tried installing jsdom with npm and it works correctly, but it doesn't when I try to install it with bower.

`main` property in component.json

Why does bower require to have main property rather than styles: [], scripts: [], files: [], like component/component etc? Component is much more helpful for build tools.

Git status: 128

jong$ bower install git://github.com/eightmedia/hammer.js
bower cloning git://github.com/eightmedia/hammer.js
bower caching git://github.com/eightmedia/hammer.js
fatal: remote error: 
  Repository not found.

bower error Git status: 128

Address relationship, if any, to component/component

Points in both #10 and #6 are, fundamentally, about this projects relationship to component/component.

Perhaps we could get a statement or paragraph about component in the README or FAQ?

Are the two mutually exclusive or is there any compatibility between, or alignment of, the projects?

bower register https fails

When trying to register a package using an https url, Bower fails with a generic error message.

bower register screenfull https://github.com/sindresorhus/screenfull.js.git
bower error Incorrect format

This works fine however:

bower register screenfull git://github.com/sindresorhus/screenfull.js.git
registered screenfull to git://github.com/sindresorhus/screenfull.js.git

Sidenote: The error message is not very descriptive either, at first I thought it was the package

Does having a component.json file not prevent an entire repo from being downloaded?

Is there proper way to setup a bower install to use it with it's OWN repo?

I was thinking that by merely including a component.json file in a repo that when running bower install, it would only actually install the things listed under main into my project.

But, it downloaded my entire github repository?

Is this the expected behavior, or did I do something wrong?

The package I uploaded is postal.

Thanks!

Component Types

I'd like to suggest a feature. Each lib adds a "type" field to their component.json. If none provided, it defaults to "lib". Other types may include "plugin", "template", "component" (aka w3c web components). Then let each project configure where they want to install each type.

So my projects for example would install anything with a "lib" type into frontend/js/lib. "template" types would install into /templates.

Let publishers specify arbitrary types and then project owners configure where they install to. If a project doesn't config for a given type it just defaults to "lib".

component.json description field

There needs to be a description field, like in package.json and Bower should make use of this when presenting a list of packages, in search and other places.

Install fails silently if tmp is located on a different device (EXDEV)

bower install will fail silently if current tmp is located on a different device then the install target (localPath)

https://github.com/twitter/bower/blob/master/lib/core/package.js#L128

error:

[Error: EXDEV, rename '/tmp/tmp-21119lpwbimo'] errno: 52, code: 'EXDEV', path: '/tmp/tmp-21119lpwbimo' }

see also:
http://stackoverflow.com/questions/7630403/node-js-rename-and-aws
http://stackoverflow.com/questions/4568689/how-do-i-move-file-a-to-a-different-partition-in-node-js

error message instead of stack trace when missing dependencies

$ bower info octo

events.js:66
        throw arguments[1]; // Unhandled 'error' event
                       ^
Error: superagent not found
    at Request.exports.lookup [as _callback] (/usr/local/lib/node_modules/bower/lib/core/source.js:16:68)
    at Request.init.self.callback (/usr/local/lib/node_modules/bower/node_modules/request/main.js:122:22)
    at Request.EventEmitter.emit (events.js:91:17)
    at Request.<anonymous> (/usr/local/lib/node_modules/bower/node_modules/request/main.js:654:16)
    at Request.EventEmitter.emit (events.js:115:20)
    at IncomingMessage.Request.start.self.req.self.httpModule.request.buffer (/usr/local/lib/node_modules/bower/node_modules/request/main.js:616:14)
    at IncomingMessage.EventEmitter.emit (events.js:115:20)
    at IncomingMessage._emitEnd (http.js:366:10)
    at HTTPParser.parserOnMessageComplete [as onMessageComplete] (http.js:149:23)
    at CleartextStream.socketOnData [as ondata] (http.js:1366:20)

edit: superagent is a dependency listed in octo's component.json

same component.json fields or different filename

yooo. I planned on using github's search api to auto-discover projects with component.json files, removing the need for a registry or any user action at all, but the problem right now is we're both using component.json but in different ways, so we already re-introduced the ambiguity of package.json :s

Reconsider package.json

At the end of the day, I can go either way on this (I care more that it works); however, both Jam and Volo seems to work very well by augmenting package.json.

An example of a package.json that I am currently using:

{

  "name":        "csbp",
  "version":     "0.0.1",
  "description": "A Non-Framework Client-Side JavaScript/HTML5 Project Boilerplate",

  "dependencies": {
    "jamjs":         "*",
    "grunt-contrib": "*"
  },

  "devDependencies": {
    "chai":          "*",
    "mocha":         "*",
    "sinon":         "*",
    "grunt-mocha":   "*"
  },

  "jam": {
    "packageDir": "src/libs/js",
    "baseUrl":    "src/main/js"
  }

}

Unable to install via npm

I'm unable to install bower via npm. When I run sudo npm install bower -g I get the following:

npm http GET https://registry.npmjs.org/bower
npm http 304 https://registry.npmjs.org/bower
npm ERR! Error: No compatible version found: bower
npm ERR! No valid targets found.
npm ERR! Perhaps not compatible with your version of node?
npm ERR!     at installTargetsError (/usr/local/lib/node_modules/npm/lib/cache.js:488:10)
npm ERR!     at next_ (/usr/local/lib/node_modules/npm/lib/cache.js:438:17)
npm ERR!     at next (/usr/local/lib/node_modules/npm/lib/cache.js:415:44)
npm ERR!     at /usr/local/lib/node_modules/npm/lib/cache.js:408:5
npm ERR!     at Object.saved [as oncomplete] (/usr/local/lib/node_modules/npm/lib/utils/npm-registry-client/get.js:147:7)
npm ERR! Report this *entire* log at:
npm ERR!     <http://github.com/isaacs/npm/issues>
npm ERR! or email it to:
npm ERR!     <[email protected]>
npm ERR! 
npm ERR! System Darwin 10.8.0
npm ERR! command "node" "/usr/local/bin/npm" "install" "bower" "-g"
npm ERR! cwd /Users/Martin
npm ERR! node -v v0.6.7
npm ERR! npm -v 1.1.0-beta-10
npm ERR! message No compatible version found: bower
npm ERR! message No valid targets found.
npm ERR! message Perhaps not compatible with your version of node?
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /Users/Martin/npm-debug.log
npm not ok

What am I doing wrong? I'm running npm version 1.1.0-beta-10, and this is the contents of my ~/npm-debug.log:

info it worked if it ends with ok
verbose cli [ 'node', '/usr/local/bin/npm', 'install', 'bower', '-g' ]
info using [email protected]
info using [email protected]
verbose config file /Users/Martin/.npmrc
verbose config file /usr/local/etc/npmrc
verbose config file /usr/local/lib/node_modules/npm/npmrc
silly exec /usr/local/bin/node "/usr/local/lib/node_modules/npm/bin/npm-get-uid-gid.js" "nobody" 20
silly spawning [ '/usr/local/bin/node',
silly spawning   [ '/usr/local/lib/node_modules/npm/bin/npm-get-uid-gid.js',
silly spawning     'nobody',
silly spawning     20 ],
silly spawning   null ]
silly output from getuid/gid {"uid":-2,"gid":20}
silly output from getuid/gid 
verbose into /usr/local/lib [ 'bower' ]
verbose cache add bower
verbose cache add [ 'bower', null ]
silly cache add: name, spec, args [ undefined, 'bower', [ 'bower', null ] ]
verbose parsed url { pathname: 'bower', path: 'bower', href: 'bower' }
verbose addNamed [ 'bower', '' ]
verbose addNamed [ null, '' ]
silly name, range, hasData [ 'bower', '', false ]
verbose raw, before any munging bower
verbose url resolving [ 'https://registry.npmjs.org/', './bower' ]
verbose url resolved https://registry.npmjs.org/bower
verbose etag "39OURAKBL67JTAMT1UFAXTMWM"
http GET https://registry.npmjs.org/bower
http 304 https://registry.npmjs.org/bower
silly get cb [ 304,
silly get cb   { server: 'CouchDB/1.2.0 (Erlang OTP/R15B)',
silly get cb     etag: '"39OURAKBL67JTAMT1UFAXTMWM"',
silly get cb     date: 'Fri, 14 Sep 2012 19:07:12 GMT',
silly get cb     'content-length': '0' } ]
verbose etag bower from cache
silly name, range, hasData 2 [ 'bower', '', true ]
silly versions [ 'bower', [] ]
ERR! Error: No compatible version found: bower
ERR! No valid targets found.
ERR! Perhaps not compatible with your version of node?
ERR!     at installTargetsError (/usr/local/lib/node_modules/npm/lib/cache.js:488:10)
ERR!     at next_ (/usr/local/lib/node_modules/npm/lib/cache.js:438:17)
ERR!     at next (/usr/local/lib/node_modules/npm/lib/cache.js:415:44)
ERR!     at /usr/local/lib/node_modules/npm/lib/cache.js:408:5
ERR!     at Object.saved [as oncomplete] (/usr/local/lib/node_modules/npm/lib/utils/npm-registry-client/get.js:147:7)
ERR! Report this *entire* log at:
ERR!     <http://github.com/isaacs/npm/issues>
ERR! or email it to:
ERR!     <[email protected]>
ERR! 
ERR! System Darwin 10.8.0
ERR! command "node" "/usr/local/bin/npm" "install" "bower" "-g"
ERR! cwd /Users/Martin
ERR! node -v v0.6.7
ERR! npm -v 1.1.0-beta-10
ERR! message No compatible version found: bower
ERR! message No valid targets found.
ERR! message Perhaps not compatible with your version of node?
verbose exit [ 1, true ]

Support multiple component versions

It might be just a lack of documentation, but I don't see how you want to support multiple versions of a library.

Let's take two scenarios:

1/ incremental upgrade

I have angular component that is at version 1.0.2 and we just released a new version, how will I update bower info to make both 1.0.2 and 1.0.3 version available to all of the apps that depend on my component?

2/ multiple paralel versions

I have angular component which is being developed and released as two branches - stable and unstable. I want to make releases from both versions available to my developers. How can I do this without having to create two separate components.

bower uninstall fails

jquery installed

$ bower list
    /home/icholy/Projects/bb
    └── jquery#1.8.1

try to uninstall

$ bower uninstall jquery

fail

/usr/local/lib/node_modules/bower/lib/commands/uninstall.js:51
        Object.keys(pkg.json.dependencies),
               ^
TypeError: Object.keys called on non-object
    at Function.keys (native)
    at module.exports.showWarnings (/usr/local/lib/node_modules/bower/lib/commands/uninstall.js:52:16)

if I stick a console.log(pgk) before that line the output is

{ dependencies: {},
  json: {},
  name: 'handlebars',
  manager: 
   { dependencies: { handlebars: [Object], jquery: [Object] },
     cwd: '/home/icholy/Projects/bb',
     endpoints: [],
     _events: { data: [Function], error: [Function], resolveLocal: [Function] } },
  path: '/home/icholy/Projects/bb/components/handlebars',
  _events: { data: [Function], error: [Function], describeTag: [Function] },
  tag: null,
  version: null }

so I'm guessing it should be switched from

Object.keys(pkg.json.dependencies)

to

Object.keys(pkg.dependencies)

or

Object.keys(pkg.manager.dependencies)

Unable to make bower work on Windows

I have the latest versions of Node, NPM and Bowser. Yet the simplest bower install jquery returns a Git error 127, same for all git:: paths, or trying to install a working Bower components.json I'm using on Mac at work.
I'm not sure where Bower is trying to download the .bower folder, didn't find anything anywhere with my files indexer. Any idea where it might be going wrong ?

component.json schema validation

component.json likely needs some schema validation because providing bower with a bad component.json results in an error that is unlikely to be helpful to the general user. For example:

undefined:6
    "page1": "git://github.com/visionmedia/page.js.git#1.1.0"
    ^
SyntaxError: Unexpected string
    at Object.parse (native)
    at Manager.loadJSON (/Users/wilmoore/local/node/versions/0.8.2/lib/node_modules/bower/lib/core/manager.js:90:27)
    at fs.readFile (fs.js:176:14)
    at fs.close (/Users/wilmoore/local/node/versions/0.8.2/lib/node_modules/bower/node_modules/glob/node_modules/graceful-fs/graceful-fs.js:92:5)
    at fs.close (/Users/wilmoore/local/node/versions/0.8.2/lib/node_modules/bower/node_modules/read-package-json/node_modules/graceful-fs/graceful-fs.js:92:5)
    at fs.close (/Users/wilmoore/local/node/versions/0.8.2/lib/node_modules/bower/node_modules/rimraf/node_modules/graceful-fs/graceful-fs.js:92:5)
    at fs.close (/Users/wilmoore/local/node/versions/0.8.2/lib/node_modules/bower/node_modules/fstream/node_modules/graceful-fs/graceful-fs.js:92:5)
    at Object.oncomplete (fs.js:297:15)

The component.json file (notice the missing comma):

{
  "name": "myProject",
  "version": "1.0.0",
  "dependencies": {
    "page": "git://github.com/visionmedia/page.js.git"
    "page1": "git://github.com/visionmedia/page.js.git#1.1.0"
  }
}

gh-pages typo

Don't use a package.json – user component.json.

bower error Git status: 127 (for list, ls)

$bower ls
bower error Git status: 127

This was working. Not sure really when it broke. I had installed Yeoman, which i have uninstalled since. I also reinstalled Bower. Still not working.

I have registered a dependency in my own remote git repository. but even if i remove that dependency it doesn't work.

My dependency can install from my remote server, but maybe i am missing a permission in my git repo.

OS: Mac OSX 10.7.4

keywords field in component.json

Like NPM modules where you can specify keywords that relate to the module it would be good have this in bower.

e.g.

{
  "name": "H5F",
  "version": "1.0.0",
  "main": "h5f.js",
  "keywords": ["forms", "html5 forms"]
}

So the search command could return useful results for a generic term like "forms".

bower install jquery no errors but nothing in components

I have the same problem yeoman. I thought it's not a yeoman problem cause yeoman uses bower. Is that right?
I'm on ubuntu 12.04lts

test23@dev:~/bower$ bower install jquery
bower cloning git://github.com/components/jquery.git
bower caching git://github.com/components/jquery.git
bower fetching jquery
bower checking out jquery#1.8.1
bower copying /home/test23/.bower/jquery
test23@dev:~/bower$ ll components/
insgesamt 8
drwxrwxr-x 2 test23 test23 4096 Sep 11 16:01 ./
drwxrwxr-x 3 test23 test23 4096 Sep 11 16:01 ../
test23@dev:~/bower$ ll 
insgesamt 12
drwxrwxr-x 3 test23 test23 4096 Sep 11 16:01 ./
drwxr-xr-x 7 test23 test23 4096 Sep 11 16:01 ../
drwxrwxr-x 2 test23 test23 4096 Sep 11 16:01 components/

On a debian system bower and yeoman is working great .

make bower and bower repositories just the meta-data repository(ies)

I'm a bit confused about the apparent requirement to put non-minified library into the component repo.

Most of the projects already have a designated location for all build artifacts, so asking everyone to copy their build artifacts into their bower component repo is puzzling.

What I'd like is to be able to just specify that for my component the build artifacts can be downloaded from a certain location.

so instead of

{
  "name"        : "angular",
  "version"     : "1.0.2",
  "main"        : "./angular.js",
  "dependencies": {
  }
}

I'd have:

{
  "name"        : "angular",
  "version"     : "1.0.2",
  "main"        : "http://code.angularjs.org/1.0.2/angular.js",
  "dependencies": {
  }
}

so bower would contain only meta-info rather than the actual artifacts.

Install of Mocha doesn't work b/c Mocha uses component's component.json

I can't seem to find the repo where the list of packages is maintained. I know this is the url ... but not sure if that list is stored in a db or in a repo somewhere.

In any event,

bower install mocha barfs b/c of dependencies. I assume this is because the component.json is the format that @visionmedia uses in https://github.com/component/component

The component.json in the Mocha repo

{
  "name": "mocha",
  "repo": "visionmedia/mocha",
  "description": "simple, flexible, fun test framework",
  "styles": ["mocha.css"],
  "scripts": []
}

Likely what Bower wants would look like this

{
  "name": "mocha",
  "version": "1.4.2.",
  "main": ["./mocha.css", "./mocha.js"]
}

However, it seems that its going off of package.json because it tries to install NPM dependencies.

Output

± bower install mocha
bower cloning git://github.com/visionmedia/mocha.git
bower cached git://github.com/visionmedia/mocha.git
bower fetching mocha
bower checking out mocha#1.4.2
bower copying C:\Users\EPS\AppData\Roaming\bower-cache\mocha
bower error commander not found
bower error debug not found
bower cloning git://github.com/visionmedia/jade.git
bower error diff not found
bower error growl not found
bower error mkdirp not found
bower cached git://github.com/visionmedia/jade.git
bower fetching jade
bower checking out jade#0.26.3
bower copying C:\Users\EPS\AppData\Roaming\bower-cache\jade
bower error mkdirp not found
bower error commander not found

I have no interest in putting myself in the middle of a client-side package manager holy war, but I will say that two competing specs with the same package file name is not a good thing (tm). I hope you guys can find a way to play nice with each others formats.

remove component from cache

I tried installing backbone in a folder, but it was taking too long so i cancelled the task.

It has now registered as cached - but the cache is invalid.

Is there a way to remove this component from the cache, or wipe the entire cache?

bower install backbone
bower cloning git://github.com/documentcloud/backbone.git
bower cached git://github.com/documentcloud/backbone.git
bower fetching backbone
bower error Git status: 128

authoring - specify branches

some repos, such as zepto, host their default build in their gh-pages branch, and not their master branch. i'd like to request that bower allow authors to specify a branch along with a repo url when registering packages.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.