others - npm - 无法运行Angular应用程序, 得到错误:Schema validation failed

我正在使用Angular7,在开发服务器上运行它时出错。

ng serve

但有错误


 D:sumanftossNew TFSFtossAngularWebPre11WebV1>ng lint -fix Your


 global Angular CLI version (7.3.9) is greater than your local version


 (7.1.4). The local Angular CLI version is used.



 To disable this warning use"ng config -g cli.warnings.versionMismatch


 false".



 Schema validation failed with the following errors: 


 Data path".builders['app-shell']" should have required property 'class'.


 Error: Schema validation failed with the following errors: 


Data path".builders['app-shell']" should have required property 'class'.


 at MergeMapSubscriber.project (D:sumanftossNew TFSFtossAngularWebPre11WebV1node_modules@angular-devkitcoresrcworkspaceworkspace.js:215:42)


 at MergeMapSubscriber._tryNext (D:sumanftossNew TFSFtossAngularWebPre11WebV1node_modulesrxjsinternaloperatorsmergeMap.js:69:27)


 at MergeMapSubscriber._next (D:sumanftossNew TFSFtossAngularWebPre11WebV1node_modulesrxjsinternaloperatorsmergeMap.js:59:18)


 at MergeMapSubscriber.Subscriber.next (D:sumanftossNew TFSFtossAngularWebPre11WebV1node_modulesrxjsinternalSubscriber.js:67:18)


 at MergeMapSubscriber.notifyNext (D:sumanftossNew TFSFtossAngularWebPre11WebV1node_modulesrxjsinternaloperatorsmergeMap.js:92:26)


 at InnerSubscriber._next (D:sumanftossNew TFSFtossAngularWebPre11WebV1node_modulesrxjsinternalInnerSubscriber.js:28:21)


 at InnerSubscriber.Subscriber.next (D:sumanftossNew TFSFtossAngularWebPre11WebV1node_modulesrxjsinternalSubscriber.js:67:18)


 at MapSubscriber._next (D:sumanftossNew TFSFtossAngularWebPre11WebV1node_modulesrxjsinternaloperatorsmap.js:55:26)


 at MapSubscriber.Subscriber.next (D:sumanftossNew TFSFtossAngularWebPre11WebV1node_modulesrxjsinternalSubscriber.js:67:18)


 at SwitchMapSubscriber.notifyNext (D:sumanftossNew TFSFtossAngularWebPre11WebV1node_modulesrxjsinternaloperatorsswitchMap.js:86:26)



我的Angular应用程序的详细信息

Angular.json ->


"$schema":"./node_modules/@angular/cli/lib/config/schema.json",


"version": 1,


"newProjectRoot":"projects",


"projects": {


"ftoss": {


"root":"",


"sourceRoot":"src",


"projectType":"application",


"prefix":"app",


"schematics": {


"@schematics/angular:component": {


"styleext":"scss"


 }


 },


"architect": {


"build": {


"builder":"@angular-devkit/build-angular:browser",


"options": {


"outputPath":"dist/ftoss",


"index":"src/index.html",


"main":"src/main.ts",


"polyfills":"src/polyfills.ts",


"tsConfig":"src/tsconfig.app.json",


"assets": [


"src/favicon.ico",


"src/assets",


"src/firebase-messaging-sw.js",


"src/manifest.json"


 ],


"styles": [


"node_modules/font-awesome/scss/font-awesome.scss",


"node_modules/angular-bootstrap-md/scss/bootstrap/bootstrap.scss",


"node_modules/angular-bootstrap-md/scss/mdb-free.scss",


"src/fonts/styles.css",


"src/fonts/stylesheet.css",


"src/styles.scss"


 ],


"scripts": [


"node_modules/chart.js/dist/Chart.js",


"node_modules/hammerjs/hammer.min.js"



 ]


 },


"configurations": {


"production": {


"fileReplacements": [


 {


"replace":"src/environments/environment.ts",


"with":"src/environments/environment.prod.ts"


 }


 ],


"optimization": true,


"outputHashing":"all",


"sourceMap": false,


"extractCss": true,


"namedChunks": false,


"aot": true,


"extractLicenses": true,


"vendorChunk": false,


"buildOptimizer": true,


"budgets": [


 {


"type":"initial",


"maximumWarning":"4mb",


"maximumError":"5mb"


 }


 ]


 }


 }


 },


"serve": {


"builder":"@angular-devkit/build-angularev-server",


"options": {


"browserTarget":"ftoss:build"


 },


"configurations": {


"production": {


"browserTarget":"ftoss:buildroduction"


 }


 }


 },


"extract-i18n": {


"builder":"@angular-devkit/build-angular:extract-i18n",


"options": {


"browserTarget":"ftoss:build"


 }


 },


"test": {


"builder":"@angular-devkit/build-angular:karma",


"options": {


"main":"src/test.ts",


"polyfills":"src/polyfills.ts",


"tsConfig":"src/tsconfig.spec.json",


"karmaConfig":"src/karma.conf.js",


"styles": [


"src/styles.scss"


 ],


"scripts": ["/src/firebase-messaging-sw.js"],


"assets": [


"src/favicon.ico",


"src/assets",


"src/firebase-messaging-sw.js",


"src/manifest.json"


 ]


 }


 },


"lint": {


"builder":"@angular-devkit/build-angular:tslint",


"options": {


"tsConfig": [


"src/tsconfig.app.json",


"src/tsconfig.spec.json"


 ],


"exclude": [


"**/node_modules/**"


 ]


 }


 }


 }


 },


"ftoss-e2e": {


"root":"e2e/",


"projectType":"application",


"prefix":"",


"architect": {


"e2e": {


"builder":"@angular-devkit/build-angularrotractor",


"options": {


"protractorConfig":"e2e/protractor.conf.js",


"devServerTarget":"ftosserve"


 },


"configurations": {


"production": {


"devServerTarget":"ftosserveroduction"


 }


 }


 },


"lint": {


"builder":"@angular-devkit/build-angular:tslint",


"options": {


"tsConfig":"e2e/tsconfig.e2e.json",


"exclude": [


"**/node_modules/**"


 ]


 }


 }


 }


 }


 },


"defaultProject":"ftoss"


}



我尝试了-

  • 我从项目中卸载了npm,再次安装了它,同样的问题,
  • 我再次清除了npm缓存,我得到同样的问题,
  • List item

时间:

我认为它与RXJS不兼容。 尝试运行这个

npm install rxjs-compat

这是由于npm audit fix安装了更新版本的 @angular-devkit/build-angular 包0.800.x版本,这是从0.13.9版本中更改的,因此,在与Angular 7一起使用时,运行这个软件包的0.800版本会中断angular cli。

要修复此问题,请使用以下方法安装较旧的稳定软件包版本:

npm install --save-dev @angular-devkit/build-angular@0.13.9

...