ngAnnotate 说 "Cannot create property '$methodName'..." 是什么意思

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

我的处境很糟糕。我需要对不是我自己编写的复杂 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 它确实完成了构建,但结果看起来很奇怪并且无法正常工作。

我应该补充一点,我对网络开发非常不熟悉,包括 g运行t。

较旧的 ngAnnotate 包存在一些问题。 g运行t-ng-annotate 依赖于 ngAnnotate。所以你必须更新 g运行t-ng-annotate 包。 您可以在项目目录中使用 "update grunt-ng-annotate" 命令,或者在 package.json 中将版本更改为最新版本,然后 运行 npm install

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

希望对您有所帮助。