Bower Issue: bower_components not created
Asked Answered
E

6

11

I've created a bower.json file in my project root but when I run:

$ bower install

I get the following output:

bower not-cached    https://github.com/mirceasinteanu/nanoScrollerJS.git#master
bower resolve       https://github.com/mirceasinteanu/nanoScrollerJS.git#master
bower not-cached    http://jamesallardice.github.io/Placeholders.js#*
bower resolve       http://jamesallardice.github.io/Placeholders.js#*
bower download      http://jamesallardice.github.io/Placeholders.js
bower cached        http://github.com/davatron5000/FitVids.js.git#1.1.0
bower validate      1.1.0 against http://github.com/davatron5000/FitVids.js.git#*
bower cached        git://github.com/jquery/jquery.git#1.10.2
bower validate      1.10.2 against git://github.com/jquery/jquery.git#~1.10.0
bower cached        git://github.com/gfranko/jquery.selectBoxIt.js.git#3.8.1
bower validate      3.8.1 against git://github.com/gfranko/jquery.selectBoxIt.js.git#*
bower cached        git://github.com/chrisabrams/commonjs.git#0.2.0
bower validate      0.2.0 against git://github.com/chrisabrams/commonjs.git#0.2.0
bower cached        git://github.com/components/jqueryui.git#1.11.2
bower validate      1.11.2 against git://github.com/components/jqueryui.git#*
bower cached        git://github.com/jonom/jquery-focuspoint.git#1.1.1
bower validate      1.1.1 against git://github.com/jonom/jquery-focuspoint.git#*
bower checkout      nanoscroller#master
bower invalid-meta  nanoscroller is missing "ignore" entry in bower.json
bower resolved      https://github.com/mirceasinteanu/nanoScrollerJS.git#5e348f0bb9
bower EHTTP         Status code of 404

No bower_components folder is created and so I get errors when referencing the bower packages.

I am using:

OSX   10.9.5
node  v0.12.0
npm   v2.5.1
bower v1.3.12
git   v1.9.2

I have tried running:

$ npm cache clean

Any help would be much appreciated.

Epochmaking answered 9/2, 2015 at 0:25 Comment(0)
B
9

Do you have a .bowerrc file in your project root?

if not you should create one and than you can follow the tutorial on:

bower.io

if you have this config file could you post it to your question :)

Bezanson answered 10/2, 2015 at 9:14 Comment(1)
@Oleander the .bowerrc file is the config file for bower. For example you can specify the path to your bower_components folder. Maby that will helpBezanson
W
8

I'm not sure about the other answer in here (including .bowerrc)...

This issue also happens when a resource is not available, or the link/mirror to it is down.

For example, I got the following error today:

bower closure-compiler#*                progress Receiving objects:  17% (202/1158), 3.82 MiB | 281.00 KiB/s
bower closure-compiler#*                progress Receiving objects:  17% (202/1158), 4.03 MiB | 264.00 KiB/s
bower closure-compiler#*                progress Receiving objects:  17% (203/1158), 4.14 MiB | 266.00 KiB/s
bower closure-compiler#*                progress Receiving objects:  17% (205/1158), 4.36 MiB | 258.00 KiB/s
bower closure-compiler#*                progress Receiving objects:  17% (205/1158), 4.81 MiB | 260.00 KiB/s
bower leaflet#*                            EHTTP Status code of 404

Which tells me that leaflet (a 3rd-party maps library I am using) is not available. And sure enough, the leaflet resource I was pointing to at the time was not available. In this case I should refer to my bower.json file, not the .bowerrc file, and check for the entry/configuration I am using for whatever resource was giving me a 404 (in this case leaflet).

Concerning the OP's comment:

No bower_components folder is created and so I get errors when referencing the bower packages.

This is because the bower install command works (or seems to work) like a transaction in that if one part fails, the whole install fails... so if you didn't have a bower_components directory before, it would not create one for you if the install failed.

Wrangler answered 27/7, 2015 at 19:27 Comment(2)
So is there a solution to this, or it is a bug, running again bower install doesn't seem to create the folderVariscite
If you ran bower install again, and it sill doesn't create the bower_components directory, then you still might have an issue. I haven't used bower in over a year though (using Webpack and loving it), so I could be wrong.Wrangler
B
5

simple steps to get bower_component folder in your application:

1) first create .bowerrc file in root of your app. (just like another file is there = , .gitignor or .sailsrc etc).

2)In .bowerrc file , specify the directory where you want you bower_component folder.see below

{
  "directory" : "assets/bower_components"
}

3) then run bower install .

it checks the .bowerrc file to get directory and create bower_component folder.

Hope it helps :)

Berrios answered 22/10, 2016 at 7:56 Comment(1)
I was having a problem when trying to use docker with my angular app that doesn't had bower_components folder. To solve that I had to use bower install and then build my image from there.Dismiss
I
1

I know this is an old post but I had similar issue and I have figured out it had nothing to do with the .bowerrc . In fact the issue was caused by the wrong version of the dependency. In my case I was manually editing the version number of the dependency to what I was thinking is the right one. However when I have reverted that version back to what it was it worked. It seems if you change the version number of the dependency to a wrong version number, the bower install silently fails without giving any error. So go ahead and make sure the versions of the listed dependencies in your bower.json are correct. or if you don't know which one is causing the problem, make a backup from the bower.json file and then delete all dependencies from the bower.json file and from the command line run bower install <yourpackage>#<version> --save for each of the dependencies.

Note : watch the '~' sign next to each version ;)

Inherit answered 1/12, 2015 at 16:38 Comment(0)
S
1

bower install --force-lastest works for me

Sandhog answered 18/1, 2019 at 22:23 Comment(0)
H
0

Check to be sure that your .bowerrc file isn't configured to store the libraries in a directory other than "bower_components" e.g. libraries. Bower may in fact be copying the files just not to where you are expecting them to be.

Hornmad answered 18/6, 2018 at 18:10 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.