node_modules / rxjs / Subject“'没有导出的成员'Subject'

时间:2019-06-22 06:52:49

标签: angular

我在有角度的应用程序中安装了材质UI,但出现错误,没有导出的成员,可观察到错误,

我删除了节点模块并重新安装,问题仍然存在

ERROR in node_modules/@angular/material/autocomplete/typings/autocomplete-trigger.d.ts(14,10): error TS2305: Module '"D:/angular2/ang/node_modules/rxjs/Observable"' has no exported member 'Observable'.
node_modules/@angular/material/chips/typings/chip-list.d.ts(15,10): error TS2305: Module '"D:/angular2/ang/node_modules/rxjs/Observable"' has no exported member 'Observable'.
node_modules/@angular/material/chips/typings/chip.d.ts(11,10): error TS2305: Module '"D:/angular2/ang/node_modules/rxjs/Subject"' has no exported member 'Subject'.
node_modules/@angular/material/core/typings/common-behaviors/error-state.d.ts(11,10): error TS2305: Module '"D:/angular2/ang/node_modules/rxjs/Subject"' has no exported member 'Subject'.
node_modules/@angular/material/core/typings/common-behaviors/initialized.d.ts(9,10): error TS2305: Module '"D:/angular2/ang/node_modules/rxjs/Observable"' has no exported member 'Observable'.
node_modules/@angular/material/core/typings/datetime/date-adapter.d.ts(9,10): error TS2305: Module '"D:/angular2/ang/node_modules/rxjs/Observable"' has no exported member 'Observable'.
node_modules/@angular/material/core/typings/datetime/date-adapter.d.ts(10,10): error TS2305: Module '"D:/angular2/ang/node_modules/rxjs/Subject"' has no exported member 'Subject'.
node_modules/@angular/material/core/typings/option/option.d.ts(1,10): error TS2305: Module '"D:/angular2/ang/node_modules/rxjs/Subject"' has no exported member 'Subject'.
node_modules/@angular/material/datepicker/typings/datepicker-intl.d.ts(1,10): error TS2305: Module '"D:/angular2/ang/node_modules/rxjs/Subject"' has no exported member 'Subject'.
node_modules/@angular/material/datepicker/typings/datepicker.d.ts(13,10): error TS2305: Module '"D:/angular2/ang/node_modules/rxjs/Subject"' has no exported member 'Subject'.
node_modules/@angular/material/dialog/typings/dialog-ref.d.ts(11,10): error TS2305: Module '"D:/angular2/ang/node_modules/rxjs/Observable"' has no exported member 'Observable'.
node_modules/@angular/material/dialog/typings/dialog.d.ts(5,10): error TS2305: Module '"D:/angular2/ang/node_modules/rxjs/Observable"' has no exported
member 'Observable'.
node_modules/@angular/material/dialog/typings/dialog.d.ts(6,10): error TS2305: Module '"D:/angular2/ang/node_modules/rxjs/Subject"' has no exported member 'Subject'.
node_modules/@angular/material/expansion/typings/expansion-panel.d.ts(13,10): error TS2305: Module '"D:/angular2/ang/node_modules/rxjs/Subject"' has no exported member 'Subject'.
node_modules/@angular/material/form-field/typings/form-field-control.d.ts(8,10): error TS2305: Module '"D:/angular2/ang/node_modules/rxjs/Observable"'
has no exported member 'Observable'.
node_modules/@angular/material/icon/typings/icon-registry.d.ts(4,10): error TS2305: Module '"D:/angular2/ang/node_modules/rxjs/Observable"' has no exported member 'Observable'.
node_modules/@angular/material/input/typings/input.d.ts(6,10): error TS2305: Module '"D:/angular2/ang/node_modules/rxjs/Subject"' has no exported member 'Subject'.
node_modules/@angular/material/menu/typings/menu-directive.d.ts(11,10): error TS2305: Module '"D:/angular2/ang/node_modules/rxjs/Observable"' has no exported member 'Observable'.
node_modules/@angular/material/menu/typings/menu-item.d.ts(11,10): error TS2305: Module '"D:/angular2/ang/node_modules/rxjs/Subject"' has no exported member 'Subject'.
node_modules/@angular/material/paginator/typings/paginator-intl.d.ts(9,10): error TS2305: Module '"D:/angular2/ang/node_modules/rxjs/Subject"' has no exported member 'Subject'.
node_modules/@angular/material/select/typings/select.d.ts(16,10): error TS2305: Module '"D:/angular2/ang/node_modules/rxjs/Observable"' has no exported member 'Observable'.
node_modules/@angular/material/sidenav/typings/drawer.d.ts(13,10): error TS2305: Module '"D:/angular2/ang/node_modules/rxjs/Subject"' has no exported member 'Subject'.
node_modules/@angular/material/sidenav/typings/drawer.d.ts(14,10): error TS2305: Module '"D:/angular2/ang/node_modules/rxjs/Observable"' has no exported member 'Observable'.
node_modules/@angular/material/snack-bar/typings/snack-bar-container.d.ts(11,10): error TS2305: Module '"D:/angular2/ang/node_modules/rxjs/Observable"' has no exported member 'Observable'.
node_modules/@angular/material/snack-bar/typings/snack-bar-container.d.ts(12,10): error TS2305: Module '"D:/angular2/ang/node_modules/rxjs/Subject"' has no exported member 'Subject'.
node_modules/@angular/material/snack-bar/typings/snack-bar-ref.d.ts(9,10): error TS2305: Module '"D:/angular2/ang/node_modules/rxjs/Observable"' has no exported member 'Observable'.
node_modules/@angular/material/sort/typings/sort-header-intl.d.ts(9,10): error TS2305: Module '"D:/angular2/ang/node_modules/rxjs/Subject"' has no exported member 'Subject'.
node_modules/@angular/material/sort/typings/sort.d.ts(11,10): error TS2305: Module '"D:/angular2/ang/node_modules/rxjs/Subject"' has no exported member 'Subject'.
node_modules/@angular/material/stepper/typings/stepper-intl.d.ts(1,10): error TS2305: Module '"D:/angular2/ang/node_modules/rxjs/Subject"' has no exported member 'Subject'.
node_modules/@angular/material/stepper/typings/stepper.d.ts(28,5): error TS2416: Property '_stepHeader' in type 'MatStepper' is not assignable to the same property in base type 'CdkStepper'.
  Type 'QueryList<ElementRef<any>>' is not assignable to type 'QueryList<FocusableOption>'.
    Property 'focus' is missing in type 'ElementRef<any>' but required in type 'FocusableOption'.
node_modules/@angular/material/table/typings/table-data-source.d.ts(9,10): error TS2305: Module '"D:/angular2/ang/node_modules/rxjs/BehaviorSubject"' has no exported member 'BehaviorSubject'.
node_modules/@angular/material/table/typings/table-data-source.d.ts(12,10): error TS2305: Module '"D:/angular2/ang/node_modules/rxjs/Subscription"' has no exported member 'Subscription'.
node_modules/@angular/material/tabs/typings/tab.d.ts(11,10): error TS2305: Module '"D:/angular2/ang/node_modules/rxjs/Subject"' has no exported member
'Subject'.
node_modules/@angular/material/tooltip/typings/tooltip.d.ts(15,10): error TS2305: Module '"D:/angular2/ang/node_modules/rxjs/Observable"' has no exported member 'Observable'.
node_modules/rxjs/BehaviorSubject.d.ts(1,15): error TS2307: Cannot find module 'rxjs-compat/BehaviorSubject'.
node_modules/rxjs/Observable.d.ts(1,15): error TS2307: Cannot find module 'rxjs-compat/Observable'.
node_modules/rxjs/Subject.d.ts(1,15): error TS2307: Cannot find module 'rxjs-compat/Subject'.
node_modules/rxjs/Subscription.d.ts(1,15): error TS2307: Cannot find module 'rxjs-compat/Subscription'.

我想成功运行我的应用程序

1 个答案:

答案 0 :(得分:1)

可能是版本问题

import { Subject } from 'rxjs/Subject'

成为

import {  Subject } from 'rxjs'

为了支持第一种导入样式,rxjs提供了rxjs-compat包。