Bower does not install component - bower

Here's the command I run
c:\projectname\www>bower install jquery --save
bower cloning git://github.com/components/jquery.git
bower cached git://github.com/components/jquery.git
bower fetching jquery
bower checking out jquery#1.9.1
bower copying C:\Users\jesse\AppData\Roaming\bower\cache\jquery\cf68c4c4e7507c8d20fee7b5f26709d9
bower installing jquery#1.9.1
Here's my component.json
{
"name": "projectname",
"version": "0.0.1",
"directory" : "scripts/components"
}
I expected to find something in c:\projectname\www\scripts\components but nothing appeared.
What am I doing wrong?
Also, it's worth noting that I tried running the same command before adding the directory property to my component.json file and nothing appeared in the components directory.

So it turns out that using a component.json file is not the correct thing to do.
I created a .bowerrc file with
{
"directory" : "scripts/components"
}
And it worked like a charm.

Related

Bower - how to download packages another folder instead the folder where the bower.json is there

I initialized a bower project under d:\myProject and if i run bower install angularjs the packages are copy in the same folder. But what i need to do is to copy the packages under d:\myprojects\src\resources\static. How can i do that?
Bower's docs tell you that adding the "directory" tag in your .bowerrc file will make bower put downloaded packages in that dir.
notice that the path is relative to where you have the project's json so in your case:
{
"directory": "src/resources/static/"
...
}
Also see this answer and this one.

Bower .bowerrc (directory) is not overiding default

I am having trouble installing files with the appropriate name folder and sub folder. Bower 1.4.1
In project root directory. I've added .bowerrc
{ "directory": "public/lib" }
When I run "bower install angular", the files are being added to the default folder bower_components. I've already tried removing bower and installing it. I've already looked into the bower configuration page. I can't seem to get it to work the way I want it to. Any solutions to my problem?

Bower - Get only files needed (not entire Repo)

I am trying to use Bower to install jquery.
The frustrating problem I have been running into is that bower downloads the entire repro. I was hoping to tell bower to install a certain version of jquery and have only those files downloaded.
I did try the suggestion here with no luck. The entire repo is still downloaded even after clearing the bower cache
I would rather have something else manage which files to download than me manually specifying the file names in bower.json
bower.json in the repo : https://github.com/jquery/jquery/blob/master/bower.json
Thank you
I think you didn't unterstand the meening of bower:
Bower is handling you dependencys, so if you do a:
bower install jquery
it should download all files.
Now to you question:
you have following options:
declare wich file you want to download:
bower install http://code.jquery.com/jquery-2.1.0.min.js
but remember:
this file cant be updated easily
search for a js only package:
expample with bootstrap:
bower install bootstrap-css-only
but remember:
these packages sometimes are not up to date
use bower-installer (recommended):
install the bower-installer:
npm install bower-installer --global
and now follow the tutorial:
bower-installer github
sorry for my bad english :-)

Why does bower install github/repo not clone my bower.json?

When I install a library from a git repo via:
bower install git#github.com:fabiantheblind/p5.js.git --save
the component gets cloned into my bower_components but there is no bower.json in the folder. Just a .bower.json.
Why is that so and how can I fix this?
I also get the output:
bower invalid-meta p5.js is missing "main" entry in bower.json
bower invalid-meta p5.js is missing "ignore" entry in bower.json
But the entries are there.
(The final aim is to use grunt-wiredep to install dependencies automagically. See my open issue here )
Okay. After fiddeling a bit more I got the answer:
My clone of the repo had the bower.json but I did not create a tag for it. So bower was still looking at the latest tag 0.3.6 where no bower.json was present.
By creating the tag 0.3.7 the problem is solved.

How can I tell bower where to install packages?

I'm figuring out how to install packages using bower.
When I 'bower install packagename', packages are installed in /app/components/.
However, I'd like to dictate the structure of my projects myself.
Is there a way to configure bower to install packages in particular places?
Bower can be configured using JSON in a .bowerrc file.
The directory setting is the path in which installed components should be saved.
If not specified it will be install in the default path.
So for example :
{
"directory" : "package/components",
"json" : "bower.json"
}
Here we tell bower to install packages in the subfolder package/components, and use a file named bower.json to store its data.

Resources