我正在构建一个我刚刚升级到Net Core RC2的Angular 2应用程序。在升级之前,我的网页将显示就好了,但现在我在我的Chrome浏览器开发工具控制台收到错误:无法加载资源404(未找到) - 文件位置错误?
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版本。我安装了一个npm install命令。它在我的Visual Studio项目中正确安装。该文件位于:
项目 - > node_modules - >引导 - > DIST - > JS - > boostrap.min.js
和
项目 - > node_modules - >引导 - > 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>
我新的Web开发,所以我不能完全肯定发生了什么。有人能指出我正确的方向吗?
如果你把这些URL地址栏,可以看到文件或给你一个404? – Jer
我没有得到任何错误,但我也没有看到这些文件(他们只是黑色的网页)。当我导航到http:// localhost:5000时,我只会遇到错误。其他文件,如我的main.bundle.js确实显示出来。 – Roka545
也许你可以看看这里:http://stackoverflow.com/questions/17775944/node-js-keep-getting-failed-to-load-resource-error-message我希望这是一个有用的文章/问题 – Jer