Node.js 鲍尔安装现代化。。。modernizer.js在哪里?
我想安装Modernizer,以便:Node.js 鲍尔安装现代化。。。modernizer.js在哪里?,node.js,gruntjs,bower,Node.js,Gruntjs,Bower,我想安装Modernizer,以便: bower install modernizr 看起来一切正常,但当我检查bower_components/Modernizer时,我看不到Modernizer.js或任何包含Modernizer.js内容的文件的任何地方(甚至子目录) 如果我安装jQuery,也需要注意类似的问题 bower install jquery bower“说”它已经安装了jQuery2.1.1,但我在任何地方都找不到它。“dist”目录只有jquery.min.map 如果
bower install modernizr
看起来一切正常,但当我检查bower_components/Modernizer时,我看不到Modernizer.js或任何包含Modernizer.js内容的文件的任何地方(甚至子目录)
如果我安装jQuery,也需要注意类似的问题
bower install jquery
bower“说”它已经安装了jQuery2.1.1,但我在任何地方都找不到它。“dist”目录只有jquery.min.map
如果相反,我需要jQuery最新版本1.X
bower install jquery#^1
我进入distjquery.js等
为什么我要经历这一切?因为最初我想安装yeoman webapp
yo webapp
然后开始选择一切(sass、bootstrap和Modernizer)。但是当我去运行它的时候
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中的链接指向nothing…jQuery.js不在那里,与Modernizr相同)我找到了一个解决方案-清理缓存:
bower cache clean
神奇的是,一切正常。当您从bower获得Modernizer时,您需要转到下载Modernizer并运行npm安装的目录。完成后,运行grunt测试,grunt将在modernizr文件夹中创建一个dist,其中包含一个modernizr-build.js文件。@goodMan,真的吗?“这快把我逼疯了”删掉了?好啊不管怎样,我找到了答案。。。我会把它贴给后人的。哈哈,这让我发疯了。这样会更好吗?没关系。通常编辑的评论,如情绪,都会被删掉,因为它们对任何人都没有帮助,也不会掩盖实际问题。@DrearedMonkey,编辑是件好事。这不是一种惩罚。每个人都可能在一段时间后遇到相同的问题,最好有清晰的问题和答案。:)我也有同样的问题,并按照建议清理了缓存,但它没有回答问题:我需要包含的modernizr.js文件在哪里?应该有一个
dist/
或其他东西,但是没有。你明白了吗?试着安装cd/modernizer&&npm
,然后运行grunt build
(见下文)。grunt build
生成相同的文件,并且运行速度比测试套件快得多。不确定原因,但grunt build
没有生成modernizer.js
文件<代码>咕噜声测试did。