Angular 2:找不到本地工作区文件('angular.json')

时间:2018-05-23 11:09:07

标签: angular npm angular-cli

更新节点,npm和angular / cli(来自angular-cli)后,我无法运行现有项目(基于angular2)。我收到错误:

  

找不到本地工作区文件('angular.json')。

我如何解决这个问题?

只需将angular-cli.json重命名为angular.json即可解决问题,但又导致了其他错误:

  

架构验证失败,并出现以下错误:数据路径“”   不应该有其他属性(项目)。

角cli.json

{
 "project": {
   "version": "1.0.0-beta.18",
   "name": "client"
 },
 "apps": [
   {
     "root": "src",
     "outDir": "dist",
     "assets": [
       "assets",
       "favicon.ico"
     ],
     "index": "index.html",
     "main": "main-polymer.ts",
     "test": "test.ts",
     "tsconfig": "tsconfig.json",
     "prefix": "app",
     "mobile": false,
     "styles": [
       "main.scss"
     ],
     "scripts": [
       "../node_modules/jquery/dist/jquery.js",
       "../node_modules/signalr/jquery.signalR.js",
       "../node_modules/tether/dist/js/tether.js",
       "../node_modules/chart.js/dist/Chart.bundle.min.js"
     ],
     "environments": {
       "source": "environments/environment.ts",
       "dev": "environments/environment.ts",
       "prod": "environments/environment.prod.ts",
       "tristan": "environments/environment.tristan.ts",
       "azure": "environments/environment.azure.ts",
       "marius": "environments/environment.marius.ts"
     }
   }
 ],
 "addons": [],
 "packages": [],
 "e2e": {
   "protractor": {
     "config": "./protractor.conf.js"
   }
 },
 "test": {
   "karma": {
     "config": "./karma.conf.js"
   }
 },
 "defaults": {
   "styleExt": "scss",
   "prefixInterfaces": false,
   "inline": {
     "style": false,
     "template": false
   },
   "spec": {
     "class": false,
     "component": true,
     "directive": true,
     "module": false,
     "pipe": true,
     "service": true
   }
 }

}

的package.json:

{
   "name": "client",
   "version": "0.0.0",
   "license": "MIT",
   "angular-cli": {},
   "scripts": {
      "start": "ng serve",
      "build": "ng build --env=prod",
      "lint": "tslint \"src/**/*.ts\"",
      "test": "ng test",
      "pree2e": "webdriver-manager update",
      "e2e": "protractor"
   },
   "private": true,
   "dependencies": {
   "@angular/common": "~2.1.0",
   "@angular/compiler": "~2.1.0",
   "@angular/core": "~2.1.0",
   "@angular/forms": "~2.1.0",
   "@angular/http": "~2.1.0",
   "@angular/material": "^2.0.0-alpha.10",
   "@angular/platform-browser": "~2.1.0",
   "@angular/platform-browser-dynamic": "~2.1.0",
   "@angular/router": "~3.1.0",
   "@types/hammerjs": "^2.0.33",
   "@types/moment": "^2.13.0",
   "@vaadin/angular2-polymer": "^1.0.0-beta5",
   "angular2-datatable": "^0.5.1",
   "angular2-moment": "^1.0.0-beta.rc.1",
   "bootstrap": "4.0.0-alpha.4",
   "chart.js": "^2.4.0",
   "core-js": "^2.4.1",
   "font-awesome": "^4.7.0",
   "glyphicons-halflings": "1.9.0",
   "hammerjs": "^2.0.8",
   "jquery": "^2.2.4",
   "jwt-decode": "^2.1.0",
   "lodash": "^4.16.6",
   "moment": "^2.15.2",
   "ng2-charts": "^1.4.1",
   "ng2-toastr": "^1.3.0",
   "rxjs": "5.0.0-beta.12",
   "signalr": "^2.2.1",
   "tether": "^1.3.7",
   "ts-helpers": "^1.1.1",
   "zone.js": "^0.6.23"
 },
 "devDependencies": {
   "@angular/cli": "^6.0.3",
   "@types/jasmine": "^2.2.30",
   "@types/lodash": "^4.14.50",
   "@types/moment": "^2.13.0",
   "@types/node": "^6.0.42",
   "@types/selenium-webdriver": "2.53.34",
   "angular-cli": "1.0.0-beta.18",
   "codelyzer": "1.0.0-beta.1",
   "jasmine-core": "2.4.1",
   "jasmine-spec-reporter": "2.5.0",
   "karma": "1.2.0",
   "karma-chrome-launcher": "^2.0.0",
   "karma-cli": "^1.0.1",
   "karma-jasmine": "^1.0.2",
   "karma-remap-istanbul": "^0.2.1",
   "protractor": "4.0.9",
   "ts-node": "1.2.1",
   "tslint": "3.13.0",
   "typescript": "~2.0.3"
 } 
}

0 个答案:

没有答案