我想安装modernizr:
bower install modernizr
并且一切似乎都没问题,但是当我在bower_components / modernizr里面检查时,我看不到任何地方(甚至不是子目录)的modernizr.js或任何具有modernizr.js内容的文件...
如果我安装jQuery
,请注意类似的说明bower install jquery
bower“说”已经安装了jQuery 2.1.1,但我无法在任何地方找到它。 'dist'目录只有jquery.min.map
如果我需要jQuery最新的1.X
bower install jquery#^1
我进入了dist jquery.js等。
为什么我要经历这一切?因为最初我想安装yeoman webapp
yo webapp
继续选择一切(sass,bootstrap和modernizr)。但是当我去运行它时
grunt serve
我明白了:
Running "serve" task
Running "clean:server" (clean) task
>> 0 paths cleaned.
Running "wiredep:app" (wiredep) task
app/index.html modified.
modernizr was not injected in your file.
Please go take a look in "C:\mobapps_html5\Working\bower_components\modernizr" f
or the file you need, then manually include it in your file.
Running "wiredep:sass" (wiredep) task
app/styles/main.scss modified.
modernizr was not injected in your file.
Please go take a look in "C:\mobapps_html5\Working\bower_components\modernizr" f
or the file you need, then manually include it in your file.
Running "concurrent:server" (concurrent) task
Running "copy:styles" (copy) task
Done, without errors.
Running "sass:server" (sass) task
File .tmp/styles/main.css created.
File .tmp/styles/main.css.map created.
Done, without errors.
Running "autoprefixer:dist" (autoprefixer) task
File .tmp/styles/main.css created.
Running "connect:livereload" (connect) task
Started connect web server on http://localhost:9000
Running "watch" task
Waiting...
Modernizr没有被注入(当然它不存在!!!)并且jQuery不起作用(index.html中的链接指向什么...... jquery.js不存在,与每个modernizr相同)
答案 0 :(得分:4)
当您从bower获得modernizr时,您需要转到下载modernizr的目录并运行npm install。完成后,运行grunt test,grunt将在modernizr文件夹文件夹中创建一个带有modernizr-build.js文件的dist。
答案 1 :(得分:3)
我找到了一个解决方案 - 清理缓存:
bower cache clean
并且神奇地一切都好。