【发布时间】:2019-02-02 05:49:54
【问题描述】:
我有最新版本的"rxjs": "^6.0.0" 和@angular/cli": "~6.0.8"
当我运行ng serve 时,我收到以下编译错误-
ERROR in node_modules/ng2-toastr/src/toast-container.component.d.ts(1,48):
/node_modules/@angular/core/core"' has no exported member'AnimationTransitionEvent'.
imported toastermodule in the below format in my app.module.ts
import {ToastrModule} from 'ngx-toastr';
也收到以下错误
error TS2305: Module '"C:/Users/user1/Sublime Text 3/NodeJS/groupchat-application/node_modules/rxjs/Observable"' has no exported member 'Observable'.
node_modules/rxjs/Observable.d.ts(1,15): error TS2307: Cannot find module 'rxjs-compat/Observable'.
imported as below in My service.ts
import { Observable, of} from "rxjs";
请指导如何进行
【问题讨论】:
-
你能粘贴编码格式的错误吗?我认为应该尝试 npm install。可能是一些包没有正确安装。
-
./node_modules/ng2-toastr/src/toast-manager.js 中的错误模块未找到:错误:无法解析 '..\NodeJS\groupchat-application 中的 'rxjs/Subject' \node_modules\ng2-toastr\src' ./node_modules/ng2-toastr/src/toast-container.component.js 中的错误 找不到模块:错误:无法解析 'C:\Users\ 中的 'rxjs/Subject' user1\Sublime Text 3\NodeJS\groupchat-application\node_modules\ng2-toastr\src' ./node_modules/ng2-toastr/src/toast-container.component.js 中的错误模块未找到:错误:无法解析' rxjs/add/operator/first' in '/NodeJS\groupchatapplication\node_modules\ng2-toastr\src'
-
我添加了 ToastrModule.forRoot() 并编译现在我收到如上的错误