这真让我抓狂。到目前为止,通过Yeoman使用Bower+Grunt一直是我沮丧和浪费时间的主要原因。我只想让我的应用程序使用最新的(2.1.0)版本jquery。
bower list
正确地报告了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 build
或grunt serve
时,<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
...
手动添加并不能解决任何问题。我完全被卡住了。我一定做错了什么,但是我已经砸了很长时间,却完全没有效果。谢谢。
grunt
构建出现问题。 - Rutwick Gangurde