无法在angular6中的`.angular-cli.json`错误中找到任何应​​用

时间:2018-05-31 18:59:35

标签: angular-cli angular6

我在新机器上克隆了现有的运行Angular6项目。当我尝试在Intellij中运行项目时,出现了错误Unable to find any apps in .angular-cli.json。我在SO中读到文件名已更改为angular.json。我可以在项目中看到angular.json。那我为什么会得到这个错误,怎么解决呢?

的package.json

{
  "name": "ui",
  "version": "0.0.0",
  "license": "MIT",
  "scripts": {
    "ng": "ng",
    "start": "ng serve",
    "build": "ng build --output-path ../public/ui",
    "test": "ng test",
    "lint": "ng lint",
    "e2e": "ng e2e",
    "json-server": "json-server --watch ./test-tools/db_for_json-server.json"
  },
  "private": true,
  "dependencies": {
    "@angular/animations": "^6.0.3",
    "@angular/cdk": "^6.1.0",
    "@angular/common": "^6.0.3",
    "@angular/compiler": "^6.0.3",
    "@angular/core": "^6.0.3",
    "@angular/forms": "^6.0.3",
    "@angular/http": "^6.0.3",
    "@angular/material": "^6.1.0",
    "@angular/platform-browser": "^6.0.3",
    "@angular/platform-browser-dynamic": "^6.0.3",
    "@angular/router": "^6.0.3",
    "core-js": "^2.4.1",
    "json-server": "^0.12.1",
    "moment": "^2.22.1",
    "rxjs": "^6.2.0",
    "rxjs-compat": "^6.2.0",
    "zone.js": "^0.8.26"
  },
  "devDependencies": {
    "@angular/cli": "^6.0.3",
    "@angular/compiler-cli": "^6.0.3",
    "@angular/language-service": "^6.0.3",
    "@types/jasmine": "~2.8.3",
    "@types/jasminewd2": "~2.0.2",
    "@types/node": "~6.0.60",
    "codelyzer": "^4.0.1",
    "jasmine-core": "~2.8.0",
    "jasmine-spec-reporter": "~4.2.1",
    "karma": "~2.0.0",
    "karma-chrome-launcher": "~2.2.0",
    "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": "~4.1.0",
    "tslint": "~5.9.1",
    "typescript": "~2.7.2",
    "@angular-devkit/build-angular": "~0.6.3"
  }
}

1 个答案:

答案 0 :(得分:0)

我错了angular-cli版本。那是1.6.5。我安装了angular-cli 6.0.7,然后构建工作正常