我的处境很糟糕。我需要对一个不是我自己编写的复杂 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”命令或将 package.json 中的版本更改为最新版本,然后运行 npm install
以下是该问题的链接:https://github.com/olov/ng-annotate/issues/139
希望有帮助。
关于javascript - 当 ngAnnotate 说 "Cannot create property ' $methodName' 时,这是什么意思...”,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/39454321/