angular - 错误 : Tried to overwrite <package_path>. __ivy_ngcc_bak 带有 ngcc 备份文件,这是不允许的

标签 angular npm angular9 angular-ivy

我已从 Angular 8 升级到 9,并按照所有步骤启用了 Ivy here .当我跑 npm install我的一些包抛出错误:
Tried to overwrite <package_path>.__ivy_ngcc_bak with an ngcc back up file, which is disallowed .

这是什么意思,为什么会这样?我很难找到有关它的任何信息。我已经为所有这些抛出此错误的软件包安装了最新版本,但在运行 npm install 时仍然出现错误。 .谢谢!

最佳答案

这是关于 ivy 编译器的问题,它是 angular 9 以后的默认编译器 (read issue details) .您可以按如下方式禁用 ivy 编译器以避免此错误。

  • 转至 tsconfig.json并找到 angularCompilerOptions .
  • 然后在下面添加
    "angularCompilerOptions": { "enableIvy": false }
  • 关于angular - 错误 : Tried to overwrite <package_path>. __ivy_ngcc_bak 带有 ngcc 备份文件,这是不允许的,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60526060/

    相关文章:

    angular - 如何将主体添加到 Angular HttpClient 删除功能

    angular - Typescript 属性 'length' 在类型上不存在

    angular - ngrx 仅在存储为空时从服务器加载数据

    node.js - 以编程方式获取 NPM 包的许可证

    node.js - npm -g list 不显示任何内容(但 npm list 会显示)

    angular - 难以使用 Angular 9 更新 minimist

    html - Angular 9 : Cannot instantiate cyclic dependency

    graphql - Apollo Graphql 与 Angular 以及标题和订阅

    angular - Angular2 中的共享 RadioButton 组件

    npm - [Vue 警告] : Failed to mount component: template or render function not defined