Angular 未找到 BrowserAnimationsModule 的动画
Angular Animations not found for BrowserAnimationsModule
我正在尝试使用如下导入行为我的 angular 4 项目导入 BrowserAnimationsModule
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
我已经使用命令
在项目文件夹中添加了动画模块
npm install --save @angular/animations
但是当我看到 node_modules
文件夹,然后是 platform-browser
文件夹时,我没有看到任何 animations
文件夹,我想这就是我收到错误的原因BrowserAnimationsModule
.
那么我可以知道如何在我的案例中导入 BrowserAnimationsModule
吗?
执行 ng serve 时出错
像您这样的接缝正在使用已经被弃用的过时的 cli。
尝试:
npm uninstall angular-cli -g
npm cache clean
npm install @angular/cli -g
还要确保你是 运行 节点版本 >= 6.9
和最新的 npm
如果您需要迁移现有的应用程序,请查看此 answer and this doc 否则安装最新的 @angular/cli
应该没问题。
我正在尝试使用如下导入行为我的 angular 4 项目导入 BrowserAnimationsModule
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
我已经使用命令
在项目文件夹中添加了动画模块npm install --save @angular/animations
但是当我看到 node_modules
文件夹,然后是 platform-browser
文件夹时,我没有看到任何 animations
文件夹,我想这就是我收到错误的原因BrowserAnimationsModule
.
那么我可以知道如何在我的案例中导入 BrowserAnimationsModule
吗?
执行 ng serve 时出错
像您这样的接缝正在使用已经被弃用的过时的 cli。 尝试:
npm uninstall angular-cli -g
npm cache clean
npm install @angular/cli -g
还要确保你是 运行 节点版本 >= 6.9
和最新的 npm
如果您需要迁移现有的应用程序,请查看此 answer and this doc 否则安装最新的 @angular/cli
应该没问题。