Miha Šušteršič Miha Šušteršič - 4 months ago 13
AngularJS Question

yeoman and bower not adding bootstrap css (angular generator)

I'm completely new to using yeoman, bower and grunt (just started learning angular), so if you need any more info please let me know and I'll update the question.

I am following along a codelab on the yeoman webpage, and so far I've managed to follow along (with a few major hiccups getting my dev environment going, but now it doesn't return any errors).

so I made my project folder and ran

yo
, selected angular and run the thing. Fairly soon into the process I got a prompt
? Overwrite package.json?
I anwsered with
y
and got the following warnings:

npm WARN package.json codelab@0.0.0 No license field.
npm WARN peerDependencies The peer dependency karma@>=0.9 included from karma-jasmine will no
npm WARN peerDependencies longer be automatically installed to fulfill the peerDependency
npm WARN peerDependencies in npm 3+. Your application will need to depend on it explicitly.
npm WARN peerDependencies The peer dependency jasmine-core@* included from karma-jasmine will no
npm WARN peerDependencies longer be automatically installed to fulfill the peerDependency
npm WARN peerDependencies in npm 3+. Your application will need to depend on it explicitly.
npm WARN peerDependencies The peer dependency karma@>=0.9 included from karma-phantomjs-launcher will no
npm WARN peerDependencies longer be automatically installed to fulfill the peerDependency
npm WARN peerDependencies in npm 3+. Your application will need to depend on it explicitly.
npm WARN peerDependencies The peer dependency phantomjs@>=1.9 included from karma-phantomjs-launcher will no
npm WARN peerDependencies longer be automatically installed to fulfill the peerDependency
npm WARN peerDependencies in npm 3+. Your application will need to depend on it explicitly.
npm WARN peerDependencies The peer dependency karma@~0.12.0 included from grunt-karma will no
npm WARN peerDependencies longer be automatically installed to fulfill the peerDependency
npm WARN peerDependencies in npm 3+. Your application will need to depend on it explicitly.
npm WARN optional dep failed, continuing fsevents@0.3.6


after that, it finished what it was doing, so I ran
bower install
again just to be sure (because of the package.json thing), and then
grunt serve
. Now grunt says done, without errors but my page only loads
main.css
. I have a strong feeling the
bootstrap.css
file is missing. This is what it looks like, when the codelab instructions say it should look like this.

If you need further info on what was generated, here's a github repository link.

Any insight on what I'm doing wrong (if anything) is welcome.

Answer

After doing the codelab I had exactly the same problem with the same result as you are getting (warnings and all). I had to just work around the issue by rolling back to bootstrap 3.3.4.

Just edit bower.json and change the bootstrap line to:

    "bootstrap": "3.3.4",

Then run the following and it should work:

    bower install
    grunt serve