我已将Angular 2升级为Angular 4.当我运行我的项目时,我面临以下错误 .
node_modules / @ angular / platform-browser / platform-browser“'没有导出成员'AnimationDriver' .
https://github.com/angular/angular/blob/master/CHANGELOG.md#400-rc1-2017-02-24
动画包我们已将动画添加到自己的包中 . 这意味着如果您不使用动画,则此额外代码不会最终出现在您的 生产环境 包中 . 这也使您可以更轻松地查找文档并更好地利用自动完成功能 . 如果你确实需要动画,像Material这样的库会自动导入模块(一旦你通过NPM安装它),或者你可以自己添加到你的主NgModule .
npm install @angular/animations@latest --save
@angular/animations/browser
import {BrowserAnimationsModule} from '@angular/platform-browser/animations';
另见Plunker in
https://github.com/angular/angular/pull/15190#issuecomment-287972812
http://angularjs.blogspot.co.at/2017/03/angular-400-now-available.html
升级指南在这里:
https://github.com/angular/universal/blob/master/UPGRADE-GUIDE.md
angular-universal github页面:
https://github.com/angular/universal
删除所有依赖项和npm install(在项目文件夹中的console . 中运行),因为它引用了一些其他依赖项 . 应该希望对你有用 .
npm isntall
我通过运行以下命令解决了这个问题:
npm install
4 回答
https://github.com/angular/angular/blob/master/CHANGELOG.md#400-rc1-2017-02-24
另见Plunker in
https://github.com/angular/angular/pull/15190#issuecomment-287972812
http://angularjs.blogspot.co.at/2017/03/angular-400-now-available.html
升级指南在这里:
https://github.com/angular/universal/blob/master/UPGRADE-GUIDE.md
angular-universal github页面:
https://github.com/angular/universal
删除所有依赖项和npm install(在项目文件夹中的console . 中运行),因为它引用了一些其他依赖项 . 应该希望对你有用 .
我通过运行以下命令解决了这个问题: