Can no longer import BrowserAnimationsModule in Angular 4.2.3

I just upgraded to Angular 4.2.3, and now I get an error message in the following line in the AppModule file:

import { BrowserAnimationsModule } from "@angular/platform-browser/animations";

Error:

./~/@angular/platform-browser/@angular/platform-browser/animations.es5.js
47:2-18 
"export 'AnimationBuilder' was not found in '@angular/animations'
./~/@angular/platform-browser/@angular/platform-browser/animations.es5.js
78:2-18 
"export 'AnimationFactory' was not found in '@angular/animations'
./~/@angular/platform-browser/@angular/platform-browser/animations.es5.js
612:15-31 
"export 'AnimationBuilder' was not found in '@angular/animations'
./~/@angular/animations/@angular/animations/browser.es5.js
39:35-45 
"export 'ɵPRE_STYLE' was not found in '@angular/animations'
./~/@angular/animations/@angular/animations/browser.es5.js
2275:29-39 
"export 'ɵPRE_STYLE' was not found in '@angular/animations'
./~/@angular/animations/@angular/animations/browser.es5.js
3808:97-107 
"export 'ɵPRE_STYLE' was not found in '@angular/animations'

This worked in Angular 4.1.2, and if I do not import this module, everything will be fine, I just do not get the animation.

Is this a bug in 4.2.3, or was there a violation somewhere?

thank

+4
source share
1 answer

Do you use Angular CLI? I had such problems after the upgrade, but they were always fixed by nuking and re-creating the node_modules directory structure in my project and / or global package.

Global Package:

npm uninstall -g @ angular / cli

npm cache clean

npm install -g @ angular/cli @latest

rm -rf node_modules dist ( rmdir/S/Q node_modules dist Windows > , rm -r -fo node_modules, dist Windows PowerShell)

npm install --save-dev @ angular/cli @latest

npm install

, , , , .

+3

Source: https://habr.com/ru/post/1679659/


All Articles