如果您需要有关生成内容的更多信息,请使用 GitHub存储库链接.欢迎任何对我做错事情(如果有的话)的见识.解决方案在完成代码实验室后,我遇到了与您得到的警告和所有结果完全相同的问题.我只能通过回退到Bootstrap 3.3.4来解决此问题.只需编辑bower.json并将Bootstrap行更改为: "bootstrap": "3.3.4",然后运行以下命令,它应该可以工作: bower install grunt serveI 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 development environment going, but now it doesn't return any errors).So I made my project folder and ran yo, selected AngularJS and run the thing. Fairly soon into the process I got a prompt ? Overwrite package.json? I answered 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 nonpm WARN peerDependencies longer be automatically installed to fulfill the peerDependencynpm 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 nonpm WARN peerDependencies longer be automatically installed to fulfill the peerDependencynpm 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 nonpm WARN peerDependencies longer be automatically installed to fulfill the peerDependencynpm 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 nonpm WARN peerDependencies longer be automatically installed to fulfill the peerDependencynpm 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 nonpm WARN peerDependencies longer be automatically installed to fulfill the peerDependencynpm WARN peerDependencies in npm 3+. Your application will need to depend on it explicitly.npm WARN optional dep failed, continuing fsevents@0.3.6After 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 information on what was generated, here's a GitHub repository link.Any insight on what I'm doing wrong (if anything) is welcome. 解决方案 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 这篇关于Yeoman和Bower不添加Bootstrap CSS(AngularJS生成器)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!
08-04 09:38
查看更多