Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Choose bower install directory

Tags:

bower

People also ask

Where does bower install packages?

Installed packages will be placed in a bower_components directory. This is created in the folder which the bower program was executed. You can change this destination using the configuration options in a . bowerrc file.

How do I install bower components?

You can also create a bower. json file and define multiple packages name with or without version. Navigate to your project folder directory and run the command “bower install”. It will download and install all the packages in your bower_components folder.

Where is .bowerrc file?

. bowerrc file located in user's home folder ( %USERPROFILE% ) bowerrc (without the dot) file located in %APPDATA%/bower/config.

How does bower install work?

Bower doesn't concatenate or minify code or do anything else - it just installs the right versions of the packages you need and their dependencies. To get started, Bower works by fetching and installing packages from all over, taking care of hunting, finding, downloading, and saving the stuff you're looking for.


Actually the .bowerrc file does work, this was an issue with my IDE not saving the file properly:

{
  "directory" : "public/components"
}

I'm still wondering why componentsDirectory still doesn't work in component.json, though.


While you can happily use Bower to manage the dependencies of your own personal projects, primarily the component.json is a description of your project for other people. If you share a component through the Bower registry the component.json goes with it to describe the dependencies. That is why your own local preferences like where to install components don't belong in there.


Another way to change installation directory temporarily is using --config option in command line:

bower install jquery --config.directory=/path/to/your/components


If you are creating this file in Notepad++, make sure the Encoding is set to "Encode in UTF-8 without BOM" and save as file type "Any".