【发布时间】:2022-04-01 16:54:13
【问题描述】:
我刚刚从 v8 升级到 Angular 13。 (我所有的角度依赖项都设置为 13.0.2)(将我的节点版本更新为 12.20.2)。当我尝试 ng 服务时,我收到以下 NGCC failed 错误
Error: Error on worker #1: TypeError: ts24.isNamedTupleMember is not a function
at StaticInterpreter.visitType (file:///Users/k28483/Documents/WORK/MAP/periscope/node_modules/@angular/compiler-cli/bundles/ngcc/src/execution/cluster/ngcc_cluster_worker.js:3340:21)
at StaticInterpreter.visitVariableDeclaration (file:///Users/k28483/Documents/WORK/MAP/periscope/node_modules/@angular/compiler-cli/bundles/ngcc/src/execution/cluster/ngcc_cluster_worker.js:3027:36)
at StaticInterpreter.visitDeclaration (file:///Users/k28483/Documents/WORK/MAP/periscope/node_modules/@angular/compiler-cli/bundles/ngcc/src/execution/cluster/ngcc_cluster_worker.js:3006:19)
at StaticInterpreter.visitAmbiguousDeclaration (file:///Users/k28483/Documents/WORK/MAP/periscope/node_modules/@angular/compiler-cli/bundles/ngcc/src/execution/cluster/ngcc_cluster_worker.js:3085:165)
at StaticInterpreter.visitIdentifier (file:///Users/k28483/Documents/WORK/MAP/periscope/node_modules/@angular/compiler-cli/bundles/ngcc/src/execution/cluster/ngcc_cluster_worker.js:2989:25)
at StaticInterpreter.visitExpression (file:///Users/k28483/Documents/WORK/MAP/periscope/node_modules/@angular/compiler-cli/bundles/ngcc/src/execution/cluster/ngcc_cluster_worker.js:2882:21)
at StaticInterpreter.visitObjectLiteralExpression (file:///Users/k28483/Documents/WORK/MAP/periscope/node_modules/@angular/compiler-cli/bundles/ngcc/src/execution/cluster/ngcc_cluster_worker.js:2934:28)
at StaticInterpreter.visitExpression (file:///Users/k28483/Documents/WORK/MAP/periscope/node_modules/@angular/compiler-cli/bundles/ngcc/src/execution/cluster/ngcc_cluster_worker.js:2880:21)
at StaticInterpreter.visitArrayLiteralExpression (file:///Users/k28483/Documents/WORK/MAP/periscope/node_modules/@angular/compiler-cli/bundles/ngcc/src/execution/cluster/ngcc_cluster_worker.js:2920:25)
at StaticInterpreter.visitExpression (file:///Users/k28483/Documents/WORK/MAP/periscope/node_modules/@angular/compiler-cli/bundles/ngcc/src/execution/cluster/ngcc_cluster_worker.js:2894:21)
at ClusterMaster.onWorkerMessage (file:///Users/k28483/Documents/WORK/MAP/periscope/node_modules/@angular/compiler-cli/bundles/ngcc/main-ngcc.js:5139:15)
at file:///Users/k28483/Documents/WORK/MAP/periscope/node_modules/@angular/compiler-cli/bundles/ngcc/main-ngcc.js:5049:72
at EventEmitter.<anonymous> (file:///Users/k28483/Documents/WORK/MAP/periscope/node_modules/@angular/compiler-cli/bundles/ngcc/main-ngcc.js:5207:15)
at EventEmitter.emit (events.js:314:20)
at Worker.<anonymous> (internal/cluster/master.js:174:13)
at Worker.emit (events.js:314:20)
at ChildProcess.<anonymous> (internal/cluster/worker.js:32:12)
at ChildProcess.emit (events.js:314:20)
at emit (internal/child_process.js:877:12)
at processTicksAndRejections (internal/process/task_queues.js:85:21)
(node:25668) UnhandledPromiseRejectionWarning: Error: NGCC failed.
at NgccProcessor.process (/Users/k28483/Documents/WORK/MAP/periscope/node_modules/@ngtools/webpack/src/ngcc_processor.js:146:19)
at /Users/k28483/Documents/WORK/MAP/periscope/node_modules/@ngtools/webpack/src/ivy/plugin.js:141:27
at Hook.eval [as call] (eval at create (/Users/k28483/Documents/WORK/MAP/periscope/node_modules/tapable/lib/HookCodeFactory.js:19:10), <anonymous>:30:1)
at Hook.CALL_DELEGATE [as _call] (/Users/k28483/Documents/WORK/MAP/periscope/node_modules/tapable/lib/Hook.js:14:14)
at Compiler.newCompilation (/Users/k28483/Documents/WORK/MAP/periscope/node_modules/webpack/lib/Compiler.js:1054:30)
at /Users/k28483/Documents/WORK/MAP/periscope/node_modules/webpack/lib/Compiler.js:1099:29
at eval (eval at create (/Users/k28483/Documents/WORK/MAP/periscope/node_modules/tapable/lib/HookCodeFactory.js:33:10), <anonymous>:18:1)
(node:25668) 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:25668) [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.
⠼ Generating browser application bundles (phase: setup)...(node:25746) UnhandledPromiseRejectionWarning: Error: write EPIPE
at process.target._send (internal/child_process.js:807:20)
at process.target.send (internal/child_process.js:678:19)
at file:///Users/k28483/Documents/WORK/MAP/periscope/node_modules/@angular/compiler-cli/bundles/ngcc/src/execution/cluster/ngcc_cluster_worker.js:13756:13
at new Promise (<anonymous>)
at sendMessageToMaster (file:///Users/k28483/Documents/WORK/MAP/periscope/node_modules/@angular/compiler-cli/bundles/ngcc/src/execution/cluster/ngcc_cluster_worker.js:13752:10)
at Worker.<anonymous> (file:///Users/k28483/Documents/WORK/MAP/periscope/node_modules/@angular/compiler-cli/bundles/ngcc/src/execution/cluster/ngcc_cluster_worker.js:13817:17)
at Worker.emit (events.js:314:20)
at process.<anonymous> (internal/cluster/worker.js:32:12)
at process.emit (events.js:314:20)
at emit (internal/child_process.js:877:12)
(node:25746) 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:25746) [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.
⠏ Generating browser application bundles (phase: setup)...(node:25741) UnhandledPromiseRejectionWarning: Error: write EPIPE
at process.target._send (internal/child_process.js:807:20)
at process.target.send (internal/child_process.js:678:19)
at file:///Users/k28483/Documents/WORK/MAP/periscope/node_modules/@angular/compiler-cli/bundles/ngcc/src/execution/cluster/ngcc_cluster_worker.js:13756:13
at new Promise (<anonymous>)
at sendMessageToMaster (file:///Users/k28483/Documents/WORK/MAP/periscope/node_modules/@angular/compiler-cli/bundles/ngcc/src/execution/cluster/ngcc_cluster_worker.js:13752:10)
at Worker.<anonymous> (file:///Users/k28483/Documents/WORK/MAP/periscope/node_modules/@angular/compiler-cli/bundles/ngcc/src/execution/cluster/ngcc_cluster_worker.js:13817:17)
at Worker.emit (events.js:314:20)
at process.<anonymous> (internal/cluster/worker.js:32:12)
at process.emit (events.js:314:20)
at emit (internal/child_process.js:877:12)
(node:25741) 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)
我尝试在 ts.config.json 中添加 enableIvy : false 如下,删除节点模块并重新安装它们。我仍然收到同样的错误我该如何解决这个问题?
"angularCompilerOptions": {
"enableIvy": false
}
【问题讨论】:
-
可能是这样的:“警告:我们不支持一次跨多个主要版本迁移。请单独迁移每个主要版本。”来自@ 987654321@?
-
逐步完善升级版本。谢谢@RandyCasburn
标签: javascript node.js angular