【问题标题】:Can't start Angular application无法启动 Angular 应用程序
【发布时间】:2022-01-12 19:56:17
【问题描述】:

在过去的几天里,我们遇到了以下错误(Google 搜索中似乎没有 match find):

npm start

ng serve

Compiling @angular/core : es2015 as esm2015
Error: Error on worker #1: TypeError: compiler_1.createMayBeForwardRefExpression is not a function

任何想法为什么或解决方法?

【问题讨论】:

    标签: angular npm single-page-application


    【解决方案1】:

    尝试升级你的全局 typscript 包

    npm install -g typscript@latest
    

    【讨论】:

    • 试过那个命令“npm install -g typescript@latest” - 但同样的错误
    • 在删除 package.lock 文件后尝试删除你的 node 模块文件夹并再次运行 npm install
    • 试过也没有成功
    【解决方案2】:

    如下更改 package.json 依赖项为我解决了这个问题

    “@angular/compiler”:“12.2.13”,转为“@angular/compiler”:“^12.2.13”,

    【讨论】:

      猜你喜欢
      • 2018-12-11
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多