在浏览完文档页面上的 AOT 教程后,我尝试编译 Angular 2 AOT 并收到以下错误
"node_modules/.bin/ngc" -p tsconfig-aot.json
TypeError: compiler.AnimationParser is not a constructor
at Function.CodeGenerator.create (C:\Projects\NeilKellyClient4\node_modules\@angular\compiler-cli\src\codegen.js:108:400)
at codegen (C:\Projects\NeilKellyClient4\node_modules\@angular\compiler-cli\src\main.js:7:36)
at Object.main (C:\Projects\NeilKellyClient4\node_modules\@angular\tsc-wrapped\src\main.js:37:16)
at Object.<anonymous> (C:\Projects\NeilKellyClient4\node_modules\@angular\compiler-cli\src\main.js:16:9)
at Module._compile (module.js:570:32)
at Object.Module._extensions..js (module.js:579:10)
at Module.load (module.js:487:32)
at tryModuleLoad (module.js:446:12)
at Function.Module._load (module.js:438:3)
at Module.runMain (module.js:604:10)
Compilation failed
我现在陷入困境。 Angular/compiler-cli 抛出此错误的任何原因?
正如你所说,这似乎是版本冲突。我遇到了同样的问题,必须重新安装该软件包才能使其正常工作,并指定版本。我建议安装发行版本并重新运行,直到获得所需的结果。无论如何,我遇到了同样的错误,2.1.2 对我有用。
npm install @angular/[email protected] /cdn-cgi/l/email-protection --save-dev
As to why,我推测软件包版本不同步。尝试跑步npm list --depth=0
看看是否会弹出任何东西。可能会提示出什么问题。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)