Bower will not install packages when .bowerrc exists
Asked Answered
C

4

7

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.

Contravallation answered 3/12, 2013 at 4:39 Comment(3)
Pleas complete your question : "What gives?" is incompleteCurley
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.Agonic
@payeli: Edited. @Juriy: Thanks for testing it. Quick question, did you use a bower.json file? Or did you just bower install angular?Contravallation
C
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!

Contravallation answered 4/12, 2013 at 1:26 Comment(1)
note for future: if you have to sudo for global package installations, read here: #19353476Yttrium
P
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.

Panegyrize answered 23/6, 2014 at 17:41 Comment(0)
L
1

Try to run with -f flag (force)

bower -f install

Liquefacient answered 19/9, 2019 at 20:49 Comment(0)
W
-1

I think that you should be reinstall the bower

npm rm -g bower
npm install bower -g
Worsley answered 14/5, 2015 at 10:22 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.