Angular 5 - 当试图在浏览器中访问http:// localhost:4200它显示“无法获取/”

时间:2018-04-13 10:06:28

标签: node.js angular npm routes angular5

这些是我遵循的步骤:

1. Installed Node Js
2. npm install -g @angular/cli
3. In F:/Angular -> ng new hellowworldapp
4. In F:/Angular/hellowworldapp -> ng serve

当我打开http://localhost:4200/时,我在浏览器中收到此错误:

  

无法获得/ **

然后我尝试 卸载并重新安装 ,但我仍然不知道发生了什么。

提前致谢。

View Compile success Screenshot here

我的 package.json 文件是:


{
  "name": "hellowworldapp",
  "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": "^6.0.0-rc.1",
    "@angular/common": "^6.0.0-rc.1",
    "@angular/compiler": "^6.0.0-rc.1",
    "@angular/core": "^6.0.0-rc.1",
    "@angular/forms": "^6.0.0-rc.1",
    "@angular/http": "^6.0.0-rc.1",
    "@angular/platform-browser": "^6.0.0-rc.1",
    "@angular/platform-browser-dynamic": "^6.0.0-rc.1",
    "@angular/router": "^6.0.0-rc.1",
    "core-js": "^2.5.4",
    "rxjs": "^6.0.0-rc.0",
    "zone.js": "^0.8.24"
  },
  "devDependencies": {
    "@angular/compiler-cli": "^6.0.0-rc.1",
    "@angular-devkit/build-angular": "~0.5.0",
    "typescript": "~2.7.2",
    "@angular/cli": "~6.0.0-rc.4",
    "@angular/language-service": "^6.0.0-rc.1",
    "@types/jasmine": "~2.8.6",
    "@types/jasminewd2": "~2.0.3",
    "@types/node": "~8.9.4",
    "codelyzer": "~4.2.1",
    "jasmine-core": "~2.99.1",
    "jasmine-spec-reporter": "~4.2.1",
    "karma": "~1.7.1",
    "karma-chrome-launcher": "~2.2.0",
    "karma-coverage-istanbul-reporter": "~1.4.2",
    "karma-jasmine": "~1.1.1",
    "karma-jasmine-html-reporter": "^0.2.2",
    "protractor": "~5.3.0",
    "ts-node": "~5.0.1",
    "tslint": "~5.9.1"
  }
}

0 个答案:

没有答案