6

I'm trying to install packages using Bower.

Without a .bowerrc file, it works. For example, bower install angular#1.0.6 will install nicely inside ./bower_components.

If there is a .bowerrc with { 'directory' : 'public/javascripts/vendor' }, bower install angular#1.0.6 will not work. Actually, the output of that command is nothing. It simply prints a blank line, then the next line is my terminal prompt. The package is not installed anywhere.

However, if there is an empty .bowerrc file, it will install the package inside ./bower_components.

Why is it not installing the packages and how can I fix it? (so they will install)

Additional info:

No bower command works. bower will fail similarly. bower help too. In fact, bower anything will too.

Sparragus
  • 883
  • 1
  • 9
  • 24
  • 2
    Pleas complete your question : `"What gives?"` is incomplete – Infinite Recursion Dec 03 '13 at 04:46
  • Also it would help to include some version info. I just tried to reproduce your problem on Win7 32bit, bower 1.2.8 and node 0.10.12. It works as a charm. – Juriy Dec 03 '13 at 13:49
  • @payeli: Edited. @Juriy: Thanks for testing it. Quick question, did you use a bower.json file? Or did you just `bower install angular`? – Sparragus Dec 04 '13 at 00:54

4 Answers4

8

I just solved this. I uninstalled and reinstalled bower, and now it works. :S

sudo npm rm -g bower

sudo npm install bower -g

Now everything works fine!

Sparragus
  • 883
  • 1
  • 9
  • 24
  • note for future: if you have to `sudo` for global package installations, read here: http://stackoverflow.com/questions/19352976/npm-modules-wont-install-globally-without-sudo – Sgnl Feb 21 '15 at 01:19
2

The solution here is simple :

  1. Install Bower in your public directory ( Not your app/node master directory ) For example, mynodeapp/public - npm install bower

  2. Then, set up bower from this directory : bower init

  3. Create your .bowercc file, and add to it : { "directory" : "vendor" } //Where vendor is your custom fldr

  4. Thats it. Now whenever you run a bower install command from within the public directory, it will either create or save to that "vendor" directory.

Everyone seems to have trouble because they are installing Bower outside their public folder.

1

Try to run with -f flag (force)

bower -f install

PURVESH PATEL
  • 199
  • 2
  • 8
-1

I think that you should be reinstall the bower

npm rm -g bower
npm install bower -g
Eric Hotinger
  • 8,957
  • 5
  • 36
  • 43
Ajay
  • 9
  • 6