我能够将Angular应用程序的版本从5.2更新到8。但是在运行'ng serve'命令后,我遇到了错误。
发生未处理的异常:找不到模块'@ angular / compiler-cli / ngcc' 有关更多详细信息,请参见“ C:\ Users \ LALIND〜1 \ AppData \ Local \ Temp \ ng-zBJgcG \ angular-errors.log”。
这是angular-errors.log
[error] Error: Cannot find module '@angular/compiler-cli/ngcc'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:636:15)
at Function.Module._load (internal/modules/cjs/loader.js:562:25)
at Module.require (internal/modules/cjs/loader.js:690:17)
at require (internal/modules/cjs/helpers.js:25:18)
at Object.<anonymous> (D:\DMS\main\node_modules\@ngtools\webpack\src\ngcc_processor.js:10:16)
at Module._compile (internal/modules/cjs/loader.js:776:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:787:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
at Module.require (internal/modules/cjs/loader.js:690:17)
at require (internal/modules/cjs/helpers.js:25:18)
at Object.<anonymous> (D:\DMS\main\node_modules\@ngtools\webpack\src\angular_compiler_plugin.js:23:26)
at Module._compile (internal/modules/cjs/loader.js:776:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:787:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
at Module.require (internal/modules/cjs/loader.js:690:17)
at require (internal/modules/cjs/helpers.js:25:18)
at Object.<anonymous> (D:\DMS\main\node_modules\@ngtools\webpack\src\index.js:13:10)
at Module._compile (internal/modules/cjs/loader.js:776:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:787:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleLoad (internal/modules/cjs/loader.js:593:12)
at Function.Module._load (internal/modules/cjs/loader.js:585:3)
at Module.require (internal/modules/cjs/loader.js:690:17)
at require (internal/modules/cjs/helpers.js:25:18)
请在下面找到package.json文件。
{
"name": "admin-angular",
"version": "0.0.0",
"license": "MIT",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e"
},
"private": true,
"dependencies": {
"@angular/animations": "^5.2.0",
"@angular/common": "^5.2.0",
"@angular/compiler": "^5.2.0",
"@angular/core": "^5.2.0",
"@angular/forms": "^5.2.0",
"@angular/platform-browser": "^5.2.0",
"@angular/platform-browser-dynamic": "^5.2.0",
"@angular/router": "^5.2.0",
"@ng-bootstrap/ng-bootstrap": "1.0.0",
"@swimlane/ngx-datatable": "^11.1.2",
"angular-calendar": "^0.22.1",
"bootstrap": "^4.0.0",
"chart.js": "^2.7.1",
"chartist": "^0.11.0",
"core-js": "^2.4.1",
"jquery": "^3.2.1",
"jquery-slimscroll": "^1.3.8",
"ng-chartist": "^1.1.1",
"ng2-charts": "^1.6.0",
"ng2-dragula": "^1.5.0",
"ng2-file-upload": "^1.3.0",
"ng2-smart-table": "^1.2.2",
"ng2-toastr": "^4.1.2",
"ngx-perfect-scrollbar": "^5.0.0",
"ngx-quill": "^2.0.4",
"pace-js": "^1.0.2",
"popper.js": "^1.12.5",
"rxjs": "^5.5.6",
"tslib": "^1.10.0",
"zone.js": "~0.9.1"
},
"devDependencies": {
"@angular-devkit/build-angular": "~0.803.14",
"@angular/cli": "^8.3.14",
"@angular/compiler-cli": "^5.2.0",
"@angular/language-service": "^5.2.0",
"@types/chartist": "^0.9.37",
"@types/jasmine": "~2.8.3",
"@types/jasminewd2": "~2.0.2",
"@types/jquery": "^3.2.5",
"@types/node": "~6.0.60",
"codelyzer": "^5.0.1",
"jasmine-core": "~2.8.0",
"jasmine-spec-reporter": "~4.2.1",
"karma": "~2.0.0",
"karma-chrome-launcher": "~2.2.0",
"karma-coverage-istanbul-reporter": "^1.2.1",
"karma-jasmine": "~1.1.0",
"karma-jasmine-html-reporter": "^0.2.2",
"node-sass": "^4.13.0",
"protractor": "~5.1.2",
"ts-node": "~4.1.0",
"tslint": "~5.9.1",
"typescript": "~2.5.3"
}
}
我检查了以下问题,并进行了跟踪。但是无法解决问题。感谢您的帮助。
can't find compiler ngcc module after upgrading Angular and project