SuicideSheep
SuicideSheep

Reputation: 5550

Angular unable to start

enter image description here

This is my first attempt on learning Angular JS and trying to run an application from here.

Below is the package.json

{
  "name": "apm",
  "version": "0.0.0",
  "license": "MIT",
    "scripts": {
      "ng": "ng",
      "start": "ng serve -o",
      "build": "ng build",
      "test": "ng test",
      "lint": "ng lint --type-check",
      "e2e": "ng e2e"
    },
    "private": true,
    "dependencies": {
      "@angular/animations": "^4.0.0",
      "@angular/common": "^4.0.0",
      "@angular/compiler": "^4.0.0",
      "@angular/core": "^4.0.0",
      "@angular/forms": "^4.0.0",
      "@angular/http": "^4.0.0",
      "@angular/platform-browser": "^4.0.0",
      "@angular/platform-browser-dynamic": "^4.0.0",
      "@angular/router": "^4.0.0",
      "bootstrap": "^3.3.7",
      "core-js": "^2.4.1",
      "rxjs": "^5.4.1",
      "zone.js": "^0.8.14"
    },
    "devDependencies": {
      "@angular/cli": "1.6.3",
      "@angular/compiler-cli": "^4.0.0",
      "@angular/language-service": "^4.0.0",
      "@types/jasmine": "~2.5.53",
      "@types/jasminewd2": "~2.0.2",
      "@types/node": "~6.0.60",
      "codelyzer": "~3.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.3.3"
    }
  }

I've executed the command npm install to make sure all dependancies have been up to date but when I try npm start the above screenshot is what I'm hitting.

I've just installed Angular CLI and verified using ng --version which showing me 1.6.3 so I assume CLI been installed correctly. What could've be the problem?

Upvotes: 2

Views: 765

Answers (2)

zgue
zgue

Reputation: 3850

I have cloned the project and it works fine. You have to use ng server instead of npm start.

You could also update the local cli with this commands

npm uninstall @angular/cli
npm install @angular/cli@latest

UPDATE

I found an issue on angulars github repository with the same error message as yours.

The error is reproducible by deleting the configuration file for the angular cli called .angular-cli.json. I deleted it and got the same error message as you.

Check that this file is not missing in your project. If it's not there then restore it from git.

Upvotes: 2

Kamil Naja
Kamil Naja

Reputation: 6682

Just upgrade Angular CLI and run ng new on new folder. There is only small changes between Angular 4 and Angular 5.

Upvotes: 1

Related Questions