Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/82.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Node.js 无法再导入Angular 4.2.3中的BrowserAnimationsModule_Node.js_Angular_Typescript_Webpack - Fatal编程技术网

Node.js 无法再导入Angular 4.2.3中的BrowserAnimationsModule

Node.js 无法再导入Angular 4.2.3中的BrowserAnimationsModule,node.js,angular,typescript,webpack,Node.js,Angular,Typescript,Webpack,我刚刚升级到Angular 4.2.3,现在我的AppModule文件中的以下行出现错误: import { BrowserAnimationsModule } from "@angular/platform-browser/animations"; 错误是: ./~/@angular/platform-browser/@angular/platform-browser/animations.es5.js 47:2-18 "export 'AnimationBuilder' was not

我刚刚升级到Angular 4.2.3,现在我的AppModule文件中的以下行出现错误:

import { BrowserAnimationsModule } from "@angular/platform-browser/animations";
错误是:

./~/@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'
这是在Angular 4.1.2中工作的,如果我不导入这个模块,一切都正常,我就不会得到动画

这是4.2.3中的一个bug,还是在某个地方发生了突破性的变化


谢谢

您正在使用Angular CLI吗?升级后我遇到过类似的问题,但它们总是通过在我的项目和/或全局包中使用nuking并重新创建node_modules目录结构来修复

全球方案:

npm卸载-g@angular/cli

npm缓存清理

npm安装-g@angular/cli@latest

本地项目包

rm-射频节点模块距离 (在Windows命令>提示符中使用rmdir/S/Q node_modules dist;在Windows PowerShell中使用rm-r-fo node_modules,dist)

npm安装--保存dev@angular/cli@latest

npm安装

不知道为什么会这样,但上面的过程似乎为我解决了这个问题