user824624
user824624

Reputation: 8080

Local workspace file ('angular.json') could not be found when updating from angular 5 to angular 6

I am updating my angular 5 project to angular 6, by following the updates

npm install --save-dev @angular/cli@latest
ng update @angular/cli
ng update @angular/core
ng update @angular/material
ng update rxjs

however when running the ng serve, the error keeps coming up as shown below

Local workspace file ('angular.json') could not be found

I am told that .angular-cli.json was replaced by a new one: angular.json, but the schema was no longer the old version,

this is my current angular-cli.json, how could I change to the angular.json

{
  "$schema": "./node_modules/@angular/cli/lib/config/schema.json",
  "project": {
    "name": "ngx-admin-demo"
  },
  "apps": [
    {
      "root": "src",
      "outDir": "dist",
      "assets": [
        "assets",
        "favicon.ico",
        "favicon.png",
        {
          "glob": "**/*",
          "input": "../node_modules/leaflet/dist/images",
          "output": "./assets/img/markers"
        }
      ],
      "index": "index.html",
      "main": "main.ts",
      "polyfills": "polyfills.ts",
      "test": "test.ts",
      "tsconfig": "tsconfig.app.json",
      "testTsconfig": "tsconfig.spec.json",
      "styles": [
        "../node_modules/bootstrap/dist/css/bootstrap.css",

        "./app/@theme/styles/styles.scss",
        "../node_modules/primeng/resources/themes/omega/theme.css",
        "../node_modules/primeng/resources/primeng.min.css",
        "styles.scss"
      ],
      "scripts": [


        "../node_modules/pace-js/pace.min.js",
        "../node_modules/echarts/dist/echarts.min.js",
        "../node_modules/chart.js/dist/Chart.min.js",
        "../src/assets/paho-mqtt.js"
      ],
      "environmentSource": "environments/environment.ts",
      "environments": {
        "dev": "environments/environment.ts",
        "prod": "environments/environment.prod.ts"
      }
    }
  ],
  "e2e": {
    "protractor": {
      "config": "./protractor.conf.js"
    }
  },
  "lint": [
    {
      "project": "src/tsconfig.app.json"
    },
    {
      "project": "src/tsconfig.spec.json"
    },
    {
      "project": "e2e/tsconfig.e2e.json"
    }
  ],
  "test": {
    "karma": {
      "config": "./karma.conf.js"
    }
  },
  "defaults": {
    "styleExt": "scss",
    "component": {}
  }
}

Upvotes: 4

Views: 2408

Answers (1)

Asmaa3107
Asmaa3107

Reputation: 776

you may need to save your changes try run this:

$ ng update @angular/cli --save

Upvotes: 6

Related Questions