gpt4 book ai didi

angular - 无法编译和查找模块 Angular/动画

转载 作者:行者123 更新时间:2023-12-04 08:41:39 25 4
gpt4 key购买 nike

这是我的错误信息,有人可以帮忙吗?

This likely means that the library (@angular/platform-browser/animations) which declares BrowserAnimationsModule has not been processed correctly by ngcc, or is not compatible with Angular Ivy. Check ifa newer version of the library is available, and update if so. Also consider checking with the library's authors to see if the library isexpected to be compatible with Ivy.37 export declare class BrowserAnimationsModule


我的 package.json :
{
"name": "hello",
"version": "0.0.0",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"test": "ng test",
"lint": "ng lint",
"e2e": "ng e2e"
},
"private": true,
"dependencies": {
"@angular/animations": "^10.2.0",
"@angular/cdk": "^10.2.5",
"@angular/common": "~10.1.6",
"@angular/compiler": "~10.1.6",
"@angular/core": "~10.1.6",
"@angular/forms": "~10.1.6",
"@angular/material": "^10.2.5",
"@angular/platform-browser": "~10.1.6",
"@angular/platform-browser-dynamic": "~10.1.6",
"@angular/router": "~10.1.6",
"rxjs": "~6.6.0",
"tslib": "^2.0.0",
"zone.js": "~0.10.2"
},
"devDependencies": {
"@angular-devkit/build-angular": "~0.1001.7",
"@angular/cli": "~10.1.7",
"@angular/compiler-cli": "~10.1.6",
"@types/node": "^12.11.1",
"@types/jasmine": "~3.5.0",
"@types/jasminewd2": "~2.0.3",
"codelyzer": "^6.0.0",
"jasmine-core": "~3.6.0",
"jasmine-spec-reporter": "~5.0.0",
"karma": "~5.0.0",
"karma-chrome-launcher": "~3.1.0",
"karma-coverage-istanbul-reporter": "~3.0.2",
"karma-jasmine": "~4.0.0",
"karma-jasmine-html-reporter": "^1.5.0",
"protractor": "~7.0.0",
"ts-node": "~8.3.0",
"tslint": "~6.1.0",
"typescript": "~4.0.2"
}
}
我的 app.module.ts :
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';

import { AppRoutingModule } from './app-routing.module';
import { AppComponent } from './app.component';
import { BooksComponent } from './books/books.component';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';

@NgModule({
declarations: [
AppComponent,
BooksComponent
],
imports: [
BrowserModule,
AppRoutingModule,
BrowserAnimationsModule
],
providers: [],
bootstrap: [AppComponent]
})
export class AppModule { }

最佳答案

首次使用npm update并尝试再次运行该应用程序。
它将更新所有依赖项,然后安装它们。如果有的话,它还会安装缺少的依赖项。

关于angular - 无法编译和查找模块 Angular/动画,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64538969/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com