本文介绍了尝试使用ngcc备份文件覆盖@ angular/cdk/stepper/step-header.d.ts .__ ivy_ngcc_bak,这是不允许的的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
使用ng update命令升级@angular/core和@angular/material后,ngcc命令失败,并出现以下错误
使用的命令:
ngcc --properties es2015 browser module main --first-only --create-ivy-entry-points
错误:
> Compiling @angular/cdk/stepper : es2015 as esm2015 > Compiling @angular/cdk/drag-drop : es2015 as esm2015 > Error: Error on worker #3: Error: Tried to overwrite node_modules/@angular/cdk/stepper/step-header.d.ts.__ivy_ngcc_bak with an ngcc back up file, which is disallowed. > at NewEntryPointFileWriter.InPlaceFileWriter.writeFileAndBackup (node_modules/@angular/compiler-cli/ngcc/src/writing/in_place_file_writer.js:37:23) > at NewEntryPointFileWriter.writeFile (node_modules/@angular/compiler-cli/ngcc/src/writing/new_entry_point_file_writer.js:64:53) > at node_modules/@angular/compiler-cli/ngcc/src/writing/new_entry_point_file_writer.js:46:69 > at Array.forEach (<anonymous>) > at NewEntryPointFileWriter.writeBundle (node_modules/@angular/compiler-cli/ngcc/src/writing/new_entry_point_file_writer.js:46:30) > at ClusterWorker.compile (node_modules/@angular/compiler-cli/ngcc/src/main.js:173:32) > at Worker.<anonymous> (node_modules/@angular/compiler-cli/ngcc/src/execution/cluster/worker.js:44:42) > at Worker.emit (events.js:321:20) > at process.<anonymous> (internal/cluster/worker.js:32:12) > at process.emit (events.js:321:20) > at ClusterMaster.onWorkerMessage (node_modules/@angular/compiler-cli/ngcc/src/execution/cluster/master.js:158:27) > at node_modules/@angular/compiler-cli/ngcc/src/execution/cluster/master.js:46:95 > at ClusterMaster.<anonymous> (node_modules/@angular/compiler-cli/ngcc/src/execution/cluster/master.js:238:57) > at step (node_modules/tslib/tslib.js:136:27) > at Object.next (node_modules/tslib/tslib.js:117:57) > at node_modules/tslib/tslib.js:110:75 > at new Promise (<anonymous>) > at Object.__awaiter (node_modules/tslib/tslib.js:106:16) > at EventEmitter.<anonymous> (node_modules/@angular/compiler-cli/ngcc/src/execution/cluster/master.js:232:32) > at EventEmitter.emit (events.js:321:20)
解决方案
关闭enableIvy确实对我有用.
在angularCompilerOptions 下的文件中的添加"enableIvy": false
After upgrading @angular/core and @angular/material using ng update command, the ngcc command fails with below error
command used:
ngcc --properties es2015 browser module main --first-only --create-ivy-entry-points
Error:
> Compiling @angular/cdk/stepper : es2015 as esm2015 > Compiling @angular/cdk/drag-drop : es2015 as esm2015 > Error: Error on worker #3: Error: Tried to overwrite node_modules/@angular/cdk/stepper/step-header.d.ts.__ivy_ngcc_bak with an ngcc back up file, which is disallowed. > at NewEntryPointFileWriter.InPlaceFileWriter.writeFileAndBackup (node_modules/@angular/compiler-cli/ngcc/src/writing/in_place_file_writer.js:37:23) > at NewEntryPointFileWriter.writeFile (node_modules/@angular/compiler-cli/ngcc/src/writing/new_entry_point_file_writer.js:64:53) > at node_modules/@angular/compiler-cli/ngcc/src/writing/new_entry_point_file_writer.js:46:69 > at Array.forEach (<anonymous>) > at NewEntryPointFileWriter.writeBundle (node_modules/@angular/compiler-cli/ngcc/src/writing/new_entry_point_file_writer.js:46:30) > at ClusterWorker.compile (node_modules/@angular/compiler-cli/ngcc/src/main.js:173:32) > at Worker.<anonymous> (node_modules/@angular/compiler-cli/ngcc/src/execution/cluster/worker.js:44:42) > at Worker.emit (events.js:321:20) > at process.<anonymous> (internal/cluster/worker.js:32:12) > at process.emit (events.js:321:20) > at ClusterMaster.onWorkerMessage (node_modules/@angular/compiler-cli/ngcc/src/execution/cluster/master.js:158:27) > at node_modules/@angular/compiler-cli/ngcc/src/execution/cluster/master.js:46:95 > at ClusterMaster.<anonymous> (node_modules/@angular/compiler-cli/ngcc/src/execution/cluster/master.js:238:57) > at step (node_modules/tslib/tslib.js:136:27) > at Object.next (node_modules/tslib/tslib.js:117:57) > at node_modules/tslib/tslib.js:110:75 > at new Promise (<anonymous>) > at Object.__awaiter (node_modules/tslib/tslib.js:106:16) > at EventEmitter.<anonymous> (node_modules/@angular/compiler-cli/ngcc/src/execution/cluster/master.js:232:32) > at EventEmitter.emit (events.js:321:20)
解决方案
Turning enableIvy off, did work for me.
from tsconfig file, under angularCompilerOptions
add "enableIvy": false
这篇关于尝试使用ngcc备份文件覆盖@ angular/cdk/stepper/step-header.d.ts .__ ivy_ngcc_bak,这是不允许的的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!