凉鞋或咕噜声不断从index.html中删除jquery

前端之家收集整理的这篇文章主要介绍了凉鞋或咕噜声不断从index.html中删除jquery前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
这让我疯狂.到目前为止,Bower Grunt(通过Yeoman)一直是沮丧和浪费时间的主要来源.所有我想要的是我的应用程序使用最新的(2.1.0)版本的 jquery.

bower列表正确报告了jquery 2.1.0作为官方更新.

我运行bower install –save jquery来更新到最后一个版本.

bower list命令现在可以正确地报告jquery#2.1.0作为依赖关系
bower.json文件现在正确地列出了需要版本的jquery作为依赖:

{
  "name": "xxx","version": "0.0.0","dependencies": {
    ...
    "angular": "1.2.13","jquery": "~2.1.0","sizzle": "1.10.16","bootstrap": "~3.0.3",...

但是,每次运行grunt构建或grunt服务时,都会提供< script src =“bower_components / jquery / dist / jquery.js”>< / script>列表从index.html中删除,从而阻止整个应用程序运行.

#> grunt serve
Running "serve" task

Running "clean:server" (clean) task
Cleaning .tmp...OK

Running "bower-install:app" (bower-install) task

jquery was not injected in your file.
Please go take a look in "app/bower_components/jquery" for the file you need,then manually include it in your file.

Running "concurrent:server" (concurrent) task
...

手动添加不能解决任何问题.我完全卡住了必须有一些我做错的事情,但我一直在敲打我的头很长时间,而完全没有生产力.谢谢.

解决方法

这里有一个很长的回答,但是我只有一个很短的时间,而且我认为我可能会给予而不是任何事情!

bower-install是一个任务,它取决于Bower包,正确地指定了其bower.json内部的主要属性. jQuery Bower包中有一些最近的东西,它不再指定此属性.没有,grunt-bower-install不能帮助太多.

解决方案是手动将jQuery引用到<! - bower:js - ><! - endbower - >之外.阻止您的HTML.

抱歉沮丧.希望jQuery很快修复它的bower.json.

原文链接:https://www.f2er.com/html/230744.html

猜你在找的HTML相关文章