Linux上的ASP dotnet核心:缺少所有Bower软件包 [英] asp dotnet core on linux: missing all bower packages
问题描述
为简单起见,我只关注一个仅由Bower安装的库,但它不会在/ lib下加载任何由Bower安装的程序包
For simplicity I am focusing one just one bower-installed library, but it doesn't load any bower-installed package under /lib
项目在Windows下可以正常运行,但在Linux下找不到凉亭安装的支持。
Project works fine under Windows, but it doesn't find bower-installed backages under Linux.
Chrome浏览器显示此错误:
Chrome shows this error:
GET http://localhost:5000/lib/pikaday/pikaday.js
404 not found
在视图中:
<script src="/lib/pikaday/pikaday.js"></script>
我的 bower.json
解决方案:
{
"name": "asp.net",
"private": true,
"dependencies": {
"bootstrap": "3.3.6",
"jquery": "2.2.0",
"jquery-validation": "1.14.0",
"jquery-validation-unobtrusive": "3.2.6",
"handsontable": "0.24.3"
}
}
( pickaday.js
是 handsontable
软件包)
如何运行 dotnet运行
/ dotnet构建
/ dotnet发布
在Linux上是否包括那些凉亭包?
How can I make dotnet run
/ dotnet build
/ dotnet publish
on linux include those bower packages?
推荐答案
正如评论中提到的用户Baklap4一样,它需要运行 bower install
,以便它通过npm检索依赖项(不会像Visual Studio)。
As user Baklap4 mentioned in the comments, it needs to run bower install
so it retrieves the dependencies via npm (it's not done automatically as in Visual Studio).
当然,您首先需要安装Bower(否则,在 dotnet publish c中,您会收到错误消息 'bower'不被识别为内部或外部命令):
Of course you need Bower installed first (otherwise on dotnet publish
you will get the error "'bower' is not recognized as an internal or external command"):
npm install -g bower
在Ubuntu中运行时,我遇到了另一个问题:
Running that in Ubuntu, I encountered this other problem:
bower install
/usr/bin/env: node: No such file or directory
可以在此处,这会在Linux中添加逻辑链接:
The solution can be found here, which is adding a logical link in linux:
ln -s /usr/bin/nodejs /usr/bin/node
最后,重复:
bower install
这篇关于Linux上的ASP dotnet核心:缺少所有Bower软件包的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!