gpt4 book ai didi

javascript - 错误 : Could not find API compiler-cli, 函数 __NGTOOLS_PRIVATE_API_2

转载 作者:行者123 更新时间:2023-12-02 21:40:46 32 4
gpt4 key购买 nike

我使用 Angular 项目并收到以下错误,

    $ ng serve 
Your global Angular CLI version (8.3.21) is greater than your local
version (7.0.7). 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 (/Users/Chaklader/WebstormProjects/Catalog/node_modules/@angular/cli/node_modules/@angular-devkit/core/src/workspace/workspace.js:215:42)
at MergeMapSubscriber._tryNext (/Users/Chaklader/WebstormProjects/Catalog/node_modules/@angular/cli/node_modules/rxjs/internal/operators/mergeMap.js:69:27)
at MergeMapSubscriber._next (/Users/Chaklader/WebstormProjects/Catalog/node_modules/@angular/cli/node_modules/rxjs/internal/operators/mergeMap.js:59:18)
at MergeMapSubscriber.Subscriber.next (/Users/Chaklader/WebstormProjects/Catalog/node_modules/@angular/cli/node_modules/rxjs/internal/Subscriber.js:67:18)
at MergeMapSubscriber.notifyNext (/Users/Chaklader/WebstormProjects/Catalog/node_modules/@angular/cli/node_modules/rxjs/internal/operators/mergeMap.js:92:26)
at InnerSubscriber._next (/Users/Chaklader/WebstormProjects/Catalog/node_modules/@angular/cli/node_modules/rxjs/internal/InnerSubscriber.js:28:21)
at InnerSubscriber.Subscriber.next (/Users/Chaklader/WebstormProjects/Catalog/node_modules/@angular/cli/node_modules/rxjs/internal/Subscriber.js:67:18)
at MapSubscriber._next (/Users/Chaklader/WebstormProjects/Catalog/node_modules/@angular/cli/node_modules/rxjs/internal/operators/map.js:55:26)
at MapSubscriber.Subscriber.next (/Users/Chaklader/WebstormProjects/Catalog/node_modules/@angular/cli/node_modules/rxjs/internal/Subscriber.js:67:18)
at SwitchMapSubscriber.notifyNext (/Users/Chaklader/WebstormProjects/Catalog/node_modules/@angular/cli/node_modules/rxjs/internal/operators/switchMap.js:86:26)

提供了package.json文件,

{
"name": "kboepdevxvd.angular",
"version": "0.0.0",
"private": true,
"dependencies": {
"rxjs": "6.5.4",
"tslib": "1.11.0",
"core-js": "2.6.11",
"zone.js": "0.10.2",
"jasmine-core": "2.99.1",
"@angular/core": "8.2.14",
"@angular/forms": "8.2.14",
"@angular/common": "8.2.14",
"@angular/router": "8.2.14",
"jasmine-marbles": "0.6.0",
"@angular/compiler": "8.2.14",
"web-animations-js": "2.3.2",
"@angular/animations": "8.2.14",
"@angular/platform-browser": "8.2.14",
"angular-in-memory-web-api": "0.8.0",
"@angular/platform-browser-dynamic": "8.2.14"
},
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e"
},
"devDependencies": {
"@angular-devkit/build-angular": "^0.900.3",
"@angular/cli": "~7.0.2",
"@angular/compiler-cli": "^9.0.2",
"@angular/language-service": "~7.0.0",
"@types/jasmine": "~2.8.8",
"@types/jasminewd2": "~2.0.3",
"@types/node": "~8.9.4",
"codelyzer": "~4.5.0",
"jasmine-core": "~2.99.1",
"jasmine-spec-reporter": "~4.2.1",
"karma": "^4.4.1",
"karma-chrome-launcher": "~2.2.0",
"karma-coverage-istanbul-reporter": "~2.0.1",
"karma-jasmine": "~1.1.2",
"karma-jasmine-html-reporter": "^0.2.2",
"protractor": "~5.4.0",
"ts-node": "~7.0.0",
"tslint": "~5.11.0",
"typescript": "~3.1.1"
}
}

如何解决这个问题?

这个问题可能非常明显,但是,这是我第一次开始使用 JavaScript 语言,所以对我来说不是。

最佳答案

将 package.json 从 "@angular-devkit/build-angular": "^0.900.3" 更新为 "^0.12.4"

运行npm install

关于javascript - 错误 : Could not find API compiler-cli, 函数 __NGTOOLS_PRIVATE_API_2,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60371274/

32 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com