我正在构建一个 Angular 2 应用程序,我刚刚升级到 Net Core RC2。升级之前,我的网页可以正常显示,但现在我的 Chrome 开发工具控制台中出现错误:
Failed to load resource: the server responded with a status of 404 (Not Found):
http://localhost:5000/lib/bootstrap/dist/js/bootstrap.min.js
Failed to load resource: the server responded with a status of 404 (Not Found):
http://localhost:5000/lib/bootstrap/dist/css/bootstrap/bootstrap.min.css
我的 package.json 文件中有版本 3.3.6 的 bootstrap。我安装了它npm 安装命令。它正确安装在我的 Visual Studio 项目中。这些文件位于:
项目 -> node_modules -> bootstrap -> dist -> js -> boostrap.min.js
and
项目 -> node_modules -> bootstrap -> dist -> css -> boostrap.min.css
我的 gulpfile 有这一部分:
var config = {
libBase: 'node_modules',
lib: [
require.resolve('bootstrap/dist/css/bootstrap.min.css'),
require.resolve('bootstrap/dist/js/bootstrap.min.js'),
path.dirname(require.resolve('bootstrap/dist/fonts/glyphicons-halflings-regular.woff')) + '/**',
require.resolve('jquery/dist/jquery.min.js'),
require.resolve('chart.js/dist/Chart.bundle.min.js')
]
};
我还在 _Layout.cshtml 文件中看到对 bootstrap.min.js 的引用:
<!doctype html>
<html lang="">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Homepage WebDev</title>
<base href="/" />
<link rel="stylesheet" href="~/lib/bootstrap/dist/css/bootstrap.min.css" />
<link rel="stylesheet" href="~/css/site.css" asp-append-version="true" />
</head>
<body>
@RenderBody()
@RenderSection("scripts", required: false)
<script src="~/lib/jquery/dist/jquery.min.js"></script>
<script src="~/lib/bootstrap/dist/js/bootstrap.min.js"></script>
<script src="~/lib/chart.js/dist/Chart.bundle.min.js"></script>
</body>
</html>
我是网络开发新手,所以我不完全确定发生了什么。有人能指出我正确的方向吗?