admin管理员组文章数量:1384189
/bower_ponents
doesn’t work.
I get 404
error:
GET /bower_ponents/jquery/jquery.js 404
My configuration is as described in Bower documentation and here:
app.use(express.static(path.join(__dirname, 'public')));
app.use('/bower_ponents', express.static(__dirname + '/bower_ponents'));
In my .html file I have:
<script src="/bower_ponents/jquery/jquery.js"></script>
But there is no /bower_ponents/jquery/jquery.js
. There is \bower_ponents\jquery\dist\jquery.js
. Did they change the configuration of Bower packages but forgot to change docs?
/bower_ponents
doesn’t work.
I get 404
error:
GET /bower_ponents/jquery/jquery.js 404
My configuration is as described in Bower documentation and here:
app.use(express.static(path.join(__dirname, 'public')));
app.use('/bower_ponents', express.static(__dirname + '/bower_ponents'));
In my .html file I have:
<script src="/bower_ponents/jquery/jquery.js"></script>
But there is no /bower_ponents/jquery/jquery.js
. There is \bower_ponents\jquery\dist\jquery.js
. Did they change the configuration of Bower packages but forgot to change docs?
-
If you look in the file system, do you see the file
/bower_ponents/jquery/jquery.js
? – dylants Commented May 29, 2014 at 14:25 -
@dylants: No, there is no such a path in the file system.
jquery.js
is located here:\public\bower_ponents\jquery\dist\jquery.js
. I know I can movejquery.js
and it will work but it seems that it is not correct, isn't it? – Green Commented May 29, 2014 at 15:54
2 Answers
Reset to default 3You should change your script tag to point to the (new) location of jQuery:
<script src="/bower_ponents/jquery/dist/jquery.js"></script>
It looks like jQuery has separated the "source" code from the "distribution" code, by providing two directories in their bower ponent. It is not remended that you move things around inside bower_ponents
since that directory is generated from the bower install.
I had the same issue. In my case, i had accidentally deleted the .bowerrc, causing the bower_ponents to be saved in the wrong place
本文标签: javascriptbowercomponents doesn’t load dependencies on the pageStack Overflow
版权声明:本文标题:javascript - bower_components doesn’t load dependencies on the page - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744510503a2609852.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论