@angular动画构建错误 - 没有导出成员'AnimationBuilder'

And*_*ban 1 angular-cli angular

我最近表演了一个

npm更新

命令并下拉Angular版本4.2.6.但是,当我跑

建立

我收到了一堆与@ angular/animations相关的构建错误.

见下文:

[alobban@linuxlaptop-advfrtsvr-advantagefreight-com afngine-ng2]$ ng build
Hash: eeeb38b2753a21366397                                                               
Time: 34119ms
chunk    {0} main.bundle.js, main.bundle.js.map (main) 870 kB {4} [initial] [rendered]
chunk    {1} polyfills.bundle.js, polyfills.bundle.js.map (polyfills) 160 kB {5} [initial] [rendered]
chunk    {2} styles.bundle.js, styles.bundle.js.map (styles) 714 kB {5} [initial] [rendered]
chunk    {3} scripts.bundle.js, scripts.bundle.js.map (scripts) 471 kB {5} [initial] [rendered]
chunk    {4} vendor.bundle.js, vendor.bundle.js.map (vendor) 3.66 MB [initial] [rendered]
chunk    {5} inline.bundle.js, inline.bundle.js.map (inline) 0 bytes [entry] [rendered]

ERROR in /usr/share/nginx/afngine-ng2/node_modules/@angular/platform-browser/animations/src/animation_builder.d.ts (8,10): Module '"/usr/share/nginx/afngine-ng2/node_modules/@angular/animations/animations"' has no exported member 'AnimationBuilder'.
/usr/share/nginx/afngine-ng2/node_modules/@angular/platform-browser/animations/src/animation_builder.d.ts (8,28): Module '"/usr/share/nginx/afngine-ng2/node_modules/@angular/animations/animations"' has no exported member 'AnimationFactory'.
/usr/share/nginx/afngine-ng2/node_modules/@angular/platform-browser/animations/src/animation_builder.d.ts (8,65): Module '"/usr/share/nginx/afngine-ng2/node_modules/@angular/animations/animations"' has no exported member 'AnimationOptions'.

ERROR in /usr/share/nginx/afngine-ng2/node_modules/@angular/platform-browser/animations/src/providers.d.ts (5,22): Non-abstract class 'InjectableAnimationEngine' does not implement inherited abstract member 'flush' from class 'AnimationEngine'.
/usr/share/nginx/afngine-ng2/node_modules/@angular/platform-browser/animations/src/providers.d.ts (5,22): Non-abstract class 'InjectableAnimationEngine' does not implement inherited abstract member 'listen' from class 'AnimationEngine'.
/usr/share/nginx/afngine-ng2/node_modules/@angular/platform-browser/animations/src/providers.d.ts (5,22): Non-abstract class 'InjectableAnimationEngine' does not implement inherited abstract member 'onInsert' from class 'AnimationEngine'.
/usr/share/nginx/afngine-ng2/node_modules/@angular/platform-browser/animations/src/providers.d.ts (5,22): Non-abstract class 'InjectableAnimationEngine' does not implement inherited abstract member 'onRemove' from class 'AnimationEngine'.
/usr/share/nginx/afngine-ng2/node_modules/@angular/platform-browser/animations/src/providers.d.ts (5,22): Non-abstract class 'InjectableAnimationEngine' does not implement inherited abstract member 'registerTrigger' from class 'AnimationEngine'.
/usr/share/nginx/afngine-ng2/node_modules/@angular/platform-browser/animations/src/providers.d.ts (5,22): Non-abstract class 'InjectableAnimationEngine' does not implement inherited abstract member 'setProperty' from class 'AnimationEngine'.
Run Code Online (Sandbox Code Playgroud)

And*_*ban 11

以下是我为解决这些问题所做的工作.我跑了命令:

npm i @angular/animations@latest
Run Code Online (Sandbox Code Playgroud)

或者删除node_modules文件夹并重新运行

npm cache clean

npm i
Run Code Online (Sandbox Code Playgroud)

正如@Z所推荐的那样.巴格利