小编典典

Yeoman和Bower不添加Bootstrap CSS(AngularJS生成器)

angularjs

我正在跟踪Yeoman网页上的一个代码实验室,到目前为止,我已经设法进行了跟踪(有一些主要的障碍使我的开发环境得以发展,但现在它不返回任何错误)。

因此,我制作了我的项目文件夹并运行yo,选择AngularJS并运行该程序。相当快地进入该过程,我得到一个提示? Overwrite package.json?y并回答了以下警告:

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

之后,它完成了所要做的工作,所以我bower install再次运行以确保(由于package.json的原因),然后运行grunt serve。现在grunt说完成了,没有错误,但是我的页面只加载了main.css。我强烈感觉bootstrap.css文件丢失。是什么样子,当代码实验室指示说,应该像这样

如果您需要有关生成内容的更多信息,请访问GitHub存储库链接

欢迎对我做错的事情有任何见解(如有)。


阅读 216

收藏
2020-07-04

共1个答案

小编典典

完成代码实验室后,我遇到了与您得到的警告和所有结果完全相同的问题。我只能通过回退到Bootstrap 3.3.4来解决此问题。

只需编辑bower.json并将Bootstrap行更改为:

    "bootstrap": "3.3.4",

然后运行以下命令,它应该可以工作:

    bower install
    grunt serve
2020-07-04