gpt4 book ai didi

angular - node_modules/ngx-toastr/toastr/toast-noanimation.component.d.ts(19,9)

转载 作者:行者123 更新时间:2023-12-03 14:45:28 38 4
gpt4 key购买 nike

shared.module.ts

import { animate, state, style, transition, trigger } from '@angular/animations';
import { ToastrModule } from 'ngx-toastr';
import { BrowserModule } from '@angular/platform-browser';

@NgModule({
declarations: [HeaderComponent, SidebarComponent],
imports: [
CommonModule,
RouterModule,
FormsModule,
NgxDatatableModule,
ToastrModule.forRoot() // ToastrModule added
],
exports: [
HeaderComponent,
SidebarComponent,
FormsModule,
NgxDatatableModule,
ToastrModule,
],
providers: []
})

这是我的共享模块
我已经安装了
npm install ngx-toastr --save
npm install @angular/animations --save

但这给了我一个错误

node_modules/@angular/animations/browser/browser.d.ts(135,9) 中的错误:错误 TS1086:无法在环境上下文中声明访问器。
node_modules/@angular/animations/browser/browser.d.ts(301,9):错误 TS1086:无法在环境上下文中声明访问器。
node_modules/ngx-toastr/portal/portal.d.ts(26,9):错误 TS1086:无法在环境上下文中声明访问器。
node_modules/ngx-toastr/toastr/toast-noanimation.component.d.ts(19,9):错误 TS1086:无法在环境上下文中声明访问器。
node_modules/ngx-toastr/toastr/toast.component.d.ts(26,9):错误 TS1086:无法在环境上下文中声明访问器。

请为此提出建议

包.json 文件
{
"name": "mop",
"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": "^9.0.1",
"@angular/common": "~8.2.14",
"@angular/compiler": "~8.2.14",
"@angular/core": "~8.2.14",
"@angular/forms": "~8.2.14",
"@angular/material": "^9.0.0",
"@angular/platform-browser": "~8.2.14",
"@angular/platform-browser-dynamic": "~8.2.14",
"@angular/router": "~8.2.14",
"@fortawesome/fontawesome-free": "^5.12.1",
"@ng-bootstrap/ng-bootstrap": "^5.2.1",
"@swimlane/ngx-datatable": "^16.0.3",
"angular-font-awesome": "^3.1.2",
"bootstrap": "^4.4.1",
"font-awesome": "^4.7.0",
"line-awesome": "^1.3.0",
"ng2-bootstrap": "^1.6.3",
"ngx-cookie-service": "^2.3.0",
"ngx-toastr": "^12.0.0",
"rxjs": "~6.4.0",
"save": "^2.4.0",
"tslib": "^1.10.0",
"zone.js": "~0.9.1"
},
"devDependencies": {
"@angular-devkit/build-angular": "~0.803.23",
"@angular/cli": "~8.3.23",
"@angular/compiler-cli": "~8.2.14",
"@angular/language-service": "~8.2.14",
"@types/jasmine": "~3.3.8",
"@types/jasminewd2": "~2.0.3",
"@types/node": "~8.9.4",
"codelyzer": "^5.0.0",
"jasmine-core": "~3.4.0",
"jasmine-spec-reporter": "~4.2.1",
"karma": "~4.1.0",
"karma-chrome-launcher": "~2.2.0",
"karma-coverage-istanbul-reporter": "~2.0.1",
"karma-jasmine": "~2.0.1",
"karma-jasmine-html-reporter": "^1.4.0",
"protractor": "~5.4.0",
"ts-node": "~7.0.0",
"tslint": "~5.15.0",
"typescript": "~3.5.3"
}
}

最佳答案

我遇到过同样的问题。我已经通过更改 package.json 中的 toastr 版本来解决它。我使用了这个“ngx-toastr”:“^10.0.4”,而不是这个“ngx-toastr”:“^12.0.0”。然后是 npm i。

关于angular - node_modules/ngx-toastr/toastr/toast-noanimation.component.d.ts(19,9),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60281234/

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