簡體   English   中英

NGCC 運行 ng serve 時編譯失敗

[英]NGCC Failing to compile when running ng serve

我嘗試更新對等依賴項,但是當我完成時,我無法再編譯我的 angular 應用程序。 我得到的輸出是:

Compiling @angular/material/core : es2015 as esm2015
Compiling @angular/material/expansion : es2015 as esm2015
Compiling @angular/router : es2015 as esm2015
Compiling ngx-plyr : es2015 as esm2015
Error: Error on worker #2: TypeError: Cannot read property 'map' of null
    at ComponentDecoratorHandler.analyze (/Users/cristianofirmani/Docs/Impero/node_modules/@angular/compiler-cli/src/ngtsc/annotations/src/component.js:215:47)
    at NgccTraitCompiler.TraitCompiler.analyzeTrait (/Users/cristianofirmani/Docs/Impero/node_modules/@angular/compiler-cli/src/ngtsc/transform/src/compilation.js:346:40)
    at analyze (/Users/cristianofirmani/Docs/Impero/node_modules/@angular/compiler-cli/src/ngtsc/transform/src/compilation.js:298:58)
    at _loop_1 (/Users/cristianofirmani/Docs/Impero/node_modules/@angular/compiler-cli/src/ngtsc/transform/src/compilation.js:320:21)
    at NgccTraitCompiler.TraitCompiler.analyzeClass (/Users/cristianofirmani/Docs/Impero/node_modules/@angular/compiler-cli/src/ngtsc/transform/src/compilation.js:326:35)
    at NgccTraitCompiler.analyzeFile (/Users/cristianofirmani/Docs/Impero/node_modules/@angular/compiler-cli/ngcc/src/analysis/ngcc_trait_compiler.js:48:26)
    at DecorationAnalyzer.analyzeProgram (/Users/cristianofirmani/Docs/Impero/node_modules/@angular/compiler-cli/ngcc/src/analysis/decoration_analyzer.js:140:39)
    at Transformer.analyzeProgram (/Users/cristianofirmani/Docs/Impero/node_modules/@angular/compiler-cli/ngcc/src/packages/transformer.js:130:57)
    at Transformer.transform (/Users/cristianofirmani/Docs/Impero/node_modules/@angular/compiler-cli/ngcc/src/packages/transformer.js:76:27)
    at /Users/cristianofirmani/Docs/Impero/node_modules/@angular/compiler-cli/ngcc/src/execution/create_compile_function.js:52:42
    at ClusterMaster.onWorkerMessage (/Users/cristianofirmani/Docs/Impero/node_modules/@angular/compiler-cli/ngcc/src/execution/cluster/master.js:195:27)
    at /Users/cristianofirmani/Docs/Impero/node_modules/@angular/compiler-cli/ngcc/src/execution/cluster/master.js:55:95
    at ClusterMaster.<anonymous> (/Users/cristianofirmani/Docs/Impero/node_modules/@angular/compiler-cli/ngcc/src/execution/cluster/master.js:293:57)
    at step (/Users/cristianofirmani/Docs/Impero/node_modules/tslib/tslib.js:140:27)
    at Object.next (/Users/cristianofirmani/Docs/Impero/node_modules/tslib/tslib.js:121:57)
    at /Users/cristianofirmani/Docs/Impero/node_modules/tslib/tslib.js:114:75
    at new Promise (<anonymous>)
    at Object.__awaiter (/Users/cristianofirmani/Docs/Impero/node_modules/tslib/tslib.js:110:16)
    at EventEmitter.<anonymous> (/Users/cristianofirmani/Docs/Impero/node_modules/@angular/compiler-cli/ngcc/src/execution/cluster/master.js:287:32)
    at EventEmitter.emit (events.js:315:20)
An unhandled exception occurred: NGCC failed.
See "/private/var/folders/32/x18y24p96ps3ycfgmnnx4cj80000gn/T/ng-GofkCm/angular-errors.log" for further details.
➜  Impero (node:55757) UnhandledPromiseRejectionWarning: Error: write EPIPE
    at process.target._send (internal/child_process.js:806:20)
    at process.target.send (internal/child_process.js:677:19)
    at /Users/cristianofirmani/Docs/Impero/node_modules/@angular/compiler-cli/ngcc/src/execution/cluster/utils.js:51:21
    at new Promise (<anonymous>)
    at Object.exports.sendMessageToMaster (/Users/cristianofirmani/Docs/Impero/node_modules/@angular/compiler-cli/ngcc/src/execution/cluster/utils.js:46:16)
    at /Users/cristianofirmani/Docs/Impero/node_modules/@angular/compiler-cli/ngcc/src/execution/cluster/worker.js:104:66
    at step (/Users/cristianofirmani/Docs/Impero/node_modules/tslib/tslib.js:140:27)
    at Object.next (/Users/cristianofirmani/Docs/Impero/node_modules/tslib/tslib.js:121:57)
    at /Users/cristianofirmani/Docs/Impero/node_modules/tslib/tslib.js:114:75
    at new Promise (<anonymous>)
(node:55757) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:55757) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
(node:55754) UnhandledPromiseRejectionWarning: Error: write EPIPE
    at process.target._send (internal/child_process.js:806:20)
    at process.target.send (internal/child_process.js:677:19)
    at /Users/cristianofirmani/Docs/Impero/node_modules/@angular/compiler-cli/ngcc/src/execution/cluster/utils.js:51:21
    at new Promise (<anonymous>)
    at Object.exports.sendMessageToMaster (/Users/cristianofirmani/Docs/Impero/node_modules/@angular/compiler-cli/ngcc/src/execution/cluster/utils.js:46:16)
    at /Users/cristianofirmani/Docs/Impero/node_modules/@angular/compiler-cli/ngcc/src/execution/cluster/worker.js:104:66
    at step (/Users/cristianofirmani/Docs/Impero/node_modules/tslib/tslib.js:140:27)
    at Object.next (/Users/cristianofirmani/Docs/Impero/node_modules/tslib/tslib.js:121:57)
    at /Users/cristianofirmani/Docs/Impero/node_modules/tslib/tslib.js:114:75
    at new Promise (<anonymous>)
(node:55754) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:55754) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
(node:55756) UnhandledPromiseRejectionWarning: Error: write EPIPE
    at process.target._send (internal/child_process.js:806:20)
    at process.target.send (internal/child_process.js:677:19)
    at /Users/cristianofirmani/Docs/Impero/node_modules/@angular/compiler-cli/ngcc/src/execution/cluster/utils.js:51:21
    at new Promise (<anonymous>)
    at Object.exports.sendMessageToMaster (/Users/cristianofirmani/Docs/Impero/node_modules/@angular/compiler-cli/ngcc/src/execution/cluster/utils.js:46:16)
    at /Users/cristianofirmani/Docs/Impero/node_modules/@angular/compiler-cli/ngcc/src/execution/cluster/worker.js:104:66
    at step (/Users/cristianofirmani/Docs/Impero/node_modules/tslib/tslib.js:140:27)
    at Object.next (/Users/cristianofirmani/Docs/Impero/node_modules/tslib/tslib.js:121:57)
    at /Users/cristianofirmani/Docs/Impero/node_modules/tslib/tslib.js:114:75
    at new Promise (<anonymous>)
(node:55756) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:55756) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

我的 Angular 版本如下:


     _                      _                 ____ _     ___
    / \   _ __   __ _ _   _| | __ _ _ __     / ___| |   |_ _|
   / △ \ | '_ \ / _` | | | | |/ _` | '__|   | |   | |    | |
  / ___ \| | | | (_| | |_| | | (_| | |      | |___| |___ | |
 /_/   \_\_| |_|\__, |\__,_|_|\__,_|_|       \____|_____|___|
                |___/
    

Angular CLI: 10.1.3
Node: 12.18.4
OS: darwin x64

Angular: 11.0.0-next.3
... core
Ivy Workspace: Yes

Package                             Version
-------------------------------------------------------------
@angular-devkit/architect           0.1001.2
@angular-devkit/build-angular       0.1001.2
@angular-devkit/core                10.1.2
@angular-devkit/schematics          10.1.3
@angular/animations                 11.0.0-next.1
@angular/cdk                        10.2.1
@angular/cli                        10.1.3
@angular/common                     11.0.0-next.4
@angular/compiler                   11.0.0-next.1
@angular/compiler-cli               10.1.4
@angular/forms                      11.0.0-next.1
@angular/language-service           11.0.0-next.1
@angular/material                   10.2.0
@angular/platform-browser           11.0.0-next.1
@angular/platform-browser-dynamic   11.0.0-next.1
@angular/router                     11.0.0-next.1
@schematics/angular                 10.1.3
@schematics/update                  0.1001.3
rxjs                                6.6.3
typescript                          4.0.2

我嘗試刪除節點模塊並重新安裝它們。 我嘗試更新到最新的 cli 版本。 我已嘗試按照錯誤報告中的說明預運行 ngcc。 我曾嘗試禁用和重新啟用 Angular Ivy。

任何幫助將不勝感激。 如果您需要任何進一步的信息,請告訴我,我很樂意提供。

正如 nrausch 所建議的,降級到 Angular 9 並禁用 Ivy 就成功了。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM