Angular 5:无法加载app / app.component.html

时间:2017-12-20 10:29:32

标签: javascript angular typescript

自升级到Angular 5.1.1以来,我遇到了一个问题。

我的模板文件在升级之前没有任何问题加载,现在我在服务应用程序时在控制台中收到此错误

  

“无法加载app.component.html”

我试图加载的每个组件的HTML文件都有一堆404错误。

这是我的package.json文件:

{
  "name": "meetnmake-front",
  "version": "0.0.0",
  "license": "MIT",
  "scripts": {
    "ng": "ng",
    "start": "ng serve",
    "build": "ng build",
    "test": "ng test",
    "lint": "ng lint",
    "e2e": "ng e2e"
  },
  "private": true,
  "dependencies": {
    "@angular/animations": "^5.1.1",
    "@angular/common": "^5.1.0",
    "@angular/compiler": "^5.1.1",
    "@angular/core": "^5.1.0",
    "@angular/forms": "^5.1.0",
    "@angular/http": "^5.1.0",
    "@angular/platform-browser": "^5.1.1",
    "@angular/platform-browser-dynamic": "^5.1.1",
    "@angular/router": "^5.1.0",
    "@ng-bootstrap/ng-bootstrap": "^1.0.0-beta.8",
    "core-js": "^2.4.1",
    "rxjs": "^5.1.0",
    "zone.js": "^0.8.4"
  },
  "devDependencies": {
    "@angular/cli": "1.6.1",
    "@angular/compiler-cli": "^5.1.1",
    "@angular/language-service": "^4.0.0",
    "@types/jasmine": "^2.5.54",
    "@types/jasminewd2": "~2.0.2",
    "@types/node": "~6.0.60",
    "angular2-template-loader": "^0.6.2",
    "codelyzer": "~4.0.1",
    "jasmine-core": "~2.6.2",
    "jasmine-spec-reporter": "~4.1.0",
    "karma": "~1.7.0",
    "karma-chrome-launcher": "~2.1.1",
    "karma-cli": "~1.0.1",
    "karma-coverage-istanbul-reporter": "^1.2.1",
    "karma-jasmine": "~1.1.0",
    "karma-jasmine-html-reporter": "^0.2.2",
    "protractor": "~5.1.2",
    "ts-node": "~3.0.4",
    "tslint": "~5.3.2",
    "typescript": "2.4.2"
  }
}

这是我的index.html文件:

<!doctype html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <title>MeetnmakeFront</title>
  <base href="/">

  <meta name="viewport" content="width=device-width, initial-scale=1">
  <link rel="icon" type="image/x-icon" href="favicon.ico">
  <link href="https://use.fontawesome.com/releases/v5.0.1/css/all.css" rel="stylesheet">
  <link href="assets/css/animate.css" rel="stylesheet"/>
</head>
<body>
  <app-root></app-root>
</body>
</html>

0 个答案:

没有答案