当ngAnnotate说“不能创建属性'$methodName'..”是什么意思?

What does it mean when ngAnnotate says "Cannot create property '$methodName'..."

本文关键字:methodName 是什么 意思 ngAnnotate 创建 不能 属性      更新时间:2023-09-26

我的处境很糟糕。我需要对一个复杂的web应用程序做一些小的修改,而这个程序不是我自己写的。然而,一开始我甚至无法构建应用程序。

项目使用grunt来构建应用程序。但是当我运行它时,我得到以下错误:

Running "ngAnnotate:dist" (ngAnnotate) task
Warning: Cannot create property '$methodName' on boolean 'false' Use --force to continue.
Aborted due to warnings.

有没有人有线索这意味着什么,我怎么能解决它?

注意:如果我运行grunt --force,它完成构建,但结果看起来很奇怪,没有功能。

我应该补充说,我对web开发相当不熟悉,包括grunt。

旧的ngAnnotate包有一些问题。grunt-ng-annotate依赖于ngAnnotate。因此,您必须更新grunt-ng-annotate包。您可以在项目目录中使用"update grunt-ng-annotate"命令或通过将包中的版本更改为最新版本来完成此操作。然后运行NPM install

这是问题的链接:https://github.com/olov/ng-annotate/issues/139

希望能有所帮助。