/ bower_components不会加载页面上的依赖关系
/bower_components
不起作用。
我得到404
错误:
GET /bower_components/jquery/jquery.js 404
我的configuration如Bower文档中所述:
app.use(express.static(path.join(__dirname, 'public'))); app.use('/bower_components', express.static(__dirname + '/bower_components'));
在我的.html文件中,我有:
<script src="/bower_components/jquery/jquery.js"></script>
但是没有/bower_components/jquery/jquery.js
。 有\bower_components\jquery\dist\jquery.js
。 他们是否改变了鲍尔软件包的configuration,但忘记更改文档?
你应该改变脚本标记来指向jQuery的(新)位置:
<script src="/bower_components/jquery/dist/jquery.js"></script>
它看起来像jQuery通过在他们的bower组件中提供两个目录将“源代码”与“分发”代码分开。 不build议您在bower_components
移动内容,因为该目录是从bower安装生成的。
我遇到过同样的问题。 在我的情况下,我不小心删除了.bowerrc,导致bower_components被保存在错误的地方