Bower will not install packages when .bowerrc exists

I am trying to install packages using Bower.

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

If there is .bowerrc with { 'directory' : 'public/javascripts/vendor' }, bower install angular#1.0.6will not work. Actually, the output of this command is nothing. It just prints an empty line, then the next line is my invitation to the terminal. The package is not installed anywhere.

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

Why doesn't he install packages and how can I fix them? (therefore they will be installed)

Additional Information:

The bower command does not work. bowerwill happen with an error. bower helpalso. In fact, bower anythingit will also be.

+6
source share
4 answers

I just solved it. I uninstalled and reinstalled the conversation and now it works .: S

sudo npm rm -g bower

sudo npm install bower -g

Now everything works fine!

+7
source

The solution here is simple:

  • Install Bower in your public directory (not in your application / node main directory) For example, mynodeapp / public - npm install bower

  • Then install bower from this directory: bower init

  • Create a .bowercc file and add to it: {"directory": "vendor"} // Where the supplier is your own fldr

  • Here it is. Now, every time you run the bower installation command from the public directory, it will either create or save "vendor" in this directory.

Everyone seems to have a problem because they install Bower outside their shared folder.

+2

-f ()

bower -f install

0

,

npm rm -g bower
npm install bower -g
-1
source

All Articles