Yeoman 和 Bower 没有添加 Bootstrap CSS(AngularJS 生成器) [英] Yeoman and Bower not adding Bootstrap CSS (AngularJS generator)

查看:21
本文介绍了Yeoman 和 Bower 没有添加 Bootstrap CSS(AngularJS 生成器)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在关注 Yeoman 网页上的 codelab,到目前为止我已经设法跟上(在让我的开发环境运行时遇到了一些主要问题,但现在它没有返回任何错误).

所以我创建了我的项目文件夹并运行 yo,选择 AngularJS 并运行它.很快我就收到了一个提示 ?覆盖 package.json? 我用 y 回答并收到以下警告:

npm WARN package.json codelab@0.0.0 无许可证字段.npm WARN peerDependencies 从 karma-jasmine 中包含的 peer 依赖 karma@>=0.9 不会npm WARN peerDependencies 不再自动安装以实现 peerDependencynpm 3+ 中的 npm WARN peerDependencies.您的应用程序需要明确依赖它.npm WARN peerDependencies 包含在 karma-jasmine 中的 peer 依赖 jasmine-core@* 不会npm WARN peerDependencies 不再自动安装以实现 peerDependencynpm 3+ 中的 npm WARN peerDependencies.您的应用程序需要明确依赖它.npm WARN peerDependencies 从 karma-phantomjs-launcher 中包含的对等依赖 karma@>=0.9 将不会npm WARN peerDependencies 不再自动安装以实现 peerDependencynpm 3+ 中的 npm WARN peerDependencies.您的应用程序需要明确依赖它.npm WARN peerDependencies 从 karma-phantomjs-launcher 中包含的对等依赖 phantomjs@>=1.9 将不会npm WARN peerDependencies 不再自动安装以实现 peerDependencynpm 3+ 中的 npm WARN peerDependencies.您的应用程序需要明确依赖它.npm WARN peerDependencies 从 grunt-karma 中包含的对等依赖 karma@~0.12.0 不会npm WARN peerDependencies 不再自动安装以实现 peerDependencynpm 3+ 中的 npm WARN peerDependencies.您的应用程序需要明确依赖它.npm WARN 可选的 dep 失败,继续 fsevents@0.3.6

在那之后,它完成了它正在做的事情,所以我再次运行 bower install 只是为了确定(因为 package.json 的事情),然后 grunt serve.现在 grunt 说完成,没有错误,但我的页面只加载 main.css.我有一种强烈的感觉 bootstrap.css 文件丢失了.这是,当 codelab 说明说它应该看起来像 this.>

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

欢迎任何关于我做错了什么(如果有的话)的见解.

解决方案

在完成 codelab 之后,我遇到了与您得到的结果完全相同的问题(警告和所有).我不得不通过回滚到 Bootstrap 3.3.4 来解决这个问题.

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

 "bootstrap": "3.3.4",

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

 凉亭安装咕噜咕噜的服务

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 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 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 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 生成器)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆