typescript 错误TS 2307:找不到模块“@angular/core”

y1aodyip  于 2023-01-27  发布在  TypeScript
关注(0)|答案(6)|浏览(260)

因此,当我尝试再次构建应用程序时,出现以下错误:
ERROR in ../../../node_modules/@angular/cdk/a11y/typings/aria-describer/aria-describer.d.ts(8,42): error TS2307: Cannot find module '@angular/core
这个错误发生在我开发我的Angular 应用程序的时候。我显然是在编程的时候得到这个错误的,但是我没有注意到它,因为只要我做了一些改变,应用程序就会继续编译。这个错误直到今天早上才开始阻止我构建应用程序。有人知道这里发生了什么吗?
完整错误:

ERROR in ../../../node_modules/@angular/cdk/a11y/typings/aria-describer/aria-describer.d.ts(8,42): error TS2307: Cannot find module '@angular/core'.
../../../node_modules/@angular/cdk/a11y/typings/focus-monitor/focus-monitor.d.ts(9,82): error TS2307: Cannot find module '@angular/core'.
../../../node_modules/@angular/cdk/a11y/typings/focus-monitor/focus-monitor.d.ts(10,28): error TS2307: Cannot find module 'rxjs/Observable'.
../../../node_modules/@angular/cdk/a11y/typings/focus-trap/focus-trap.d.ts(8,65): error TS2307: Cannot find module '@angular/core'.
../../../node_modules/@angular/cdk/a11y/typings/key-manager/list-key-manager.d.ts(8,27): error TS2307: Cannot find module '@angular/core'.
../../../node_modules/@angular/cdk/a11y/typings/key-manager/list-key-manager.d.ts(9,25): error TS2307: Cannot find module 'rxjs/Subject'.
../../../node_modules/@angular/cdk/a11y/typings/live-announcer/live-announcer.d.ts(8,53): error TS2307: Cannot find module '@angular/core'.
../../../node_modules/@angular/cdk/accordion/typings/accordion-item.d.ts(8,60): error TS2307: Cannot find module '@angular/core'.
../../../node_modules/@angular/cdk/bidi/typings/dir.d.ts(8,59): error TS2307: Cannot find module '@angular/core'.



../../../node_modules/@angular/cdk/bidi/typings/directionality.d.ts(8,46): error TS2307: Cannot find module '@angular/core'.
../../../node_modules/@angular/cdk/collections/typings/collection-viewer.d.ts(8,28): error TS2307: Cannot find module 'rxjs/Observable'.
../../../node_modules/@angular/cdk/collections/typings/data-source.d.ts(8,28): error TS2307: Cannot find module 'rxjs/Observable'.
../../../node_modules/@angular/cdk/collections/typings/selection.d.ts(8,25): error TS2307: Cannot find module 'rxjs/Subject'.
../../../node_modules/@angular/cdk/collections/typings/unique-selection-dispatcher.d.ts(8,37): error TS2307: Cannot find module '@angular/core'.
../../../node_modules/@angular/cdk/layout/typings/breakpoints-observer.d.ts(8,35): error TS2307: Cannot find module '@angular/core'.
../../../node_modules/@angular/cdk/layout/typings/breakpoints-observer.d.ts(10,28): error TS2307: Cannot find module 'rxjs/Observable'.
../../../node_modules/@angular/cdk/overlay/typings/keyboard/overlay-keyboard-dispatcher.d.ts(8,53): error TS2307: Cannot find module '@angular/core'.
../../../node_modules/@angular/cdk/overlay/typings/overlay-container.d.ts(8,53): error TS2307: Cannot find module '@angular/core'.
../../../node_modules/@angular/cdk/overlay/typings/overlay-directives.d.ts(9,126): error TS2307: Cannot find module '@angular/core'.
../../../node_modules/@angular/cdk/overlay/typings/overlay-module.d.ts(1,26): error TS2307: Cannot find module '@angular/core'.
../../../node_modules/@angular/cdk/overlay/typings/overlay-ref.d.ts(10,55): error TS2307: Cannot find module '@angular/core'.
../../../node_modules/@angular/cdk/overlay/typings/overlay-ref.d.ts(11,28): error TS2307: Cannot find module 'rxjs/Observable'.
../../../node_modules/@angular/cdk/overlay/typings/overlay-ref.d.ts(12,25): error TS2307: Cannot find module 'rxjs/Subject'.
../../../node_modules/@angular/cdk/overlay/typings/overlay.d.ts(8,76): error TS2307: Cannot find module '@angular/core'.
../../../node_modules/@angular/cdk/overlay/typings/position/connected-position-strategy.d.ts(9,28): error TS2307: Cannot find module '@angular/core'.
../../../node_modules/@angular/cdk/overlay/typings/position/connected-position-strategy.d.ts(12,28): error TS2307: Cannot find module 'rxjs/Observable'.
../../../node_modules/@angular/cdk/overlay/typings/position/overlay-position-builder.d.ts(8,28): error TS2307: Cannot find module '@angular/core'.
../../../node_modules/@angular/cdk/overlay/typings/scroll/close-scroll-strategy.d.ts(8,24): error TS2307: Cannot find module '@angular/core'.
../../../node_modules/@angular/cdk/overlay/typings/scroll/reposition-scroll-strategy.d.ts(8,24): error TS2307: Cannot find module '@angular/core'.
../../../node_modules/@angular/cdk/overlay/typings/scroll/scroll-strategy-options.d.ts(8,24): error TS2307: Cannot find module '@angular/core'.
../../../node_modules/@angular/cdk/portal/typings/dom-portal-outlet.d.ts(8,99): error TS2307: Cannot find module '@angular/core'.
../../../node_modules/@angular/cdk/portal/typings/portal-directives.d.ts(8,137): error TS2307: Cannot find module '@angular/core'.
../../../node_modules/@angular/cdk/portal/typings/portal-injector.d.ts(8,26): error TS2307: Cannot find module '@angular/core'.
../../../node_modules/@angular/cdk/portal/typings/portal.d.ts(8,100): error TS2307: Cannot find module '@angular/core'.
../../../node_modules/@angular/cdk/scrolling/typings/scroll-dispatcher.d.ts(8,57): error TS2307: Cannot find module '@angular/core'.
../../../node_modules/@angular/cdk/scrolling/typings/scroll-dispatcher.d.ts(10,30): error TS2307: Cannot find module 'rxjs/Subscription'.
../../../node_modules/@angular/cdk/scrolling/typings/scroll-dispatcher.d.ts(11,28): error TS2307: Cannot find module 'rxjs/Observable'.
../../../node_modules/@angular/cdk/scrolling/typings/scrollable.d.ts(8,55): error TS2307: Cannot find module '@angular/core'.
../../../node_modules/@angular/cdk/scrolling/typings/scrollable.d.ts(9,28): error TS2307: Cannot find module 'rxjs/Observable'.
../../../node_modules/@angular/cdk/scrolling/typings/viewport-ruler.d.ts(8,45): error TS2307: Cannot find module '@angular/core'.
../../../node_modules/@angular/cdk/scrolling/typings/viewport-ruler.d.ts(10,28): error TS2307: Cannot find module 'rxjs/Observable'.
../../../node_modules/@angular/cdk/stepper/typings/step-label.d.ts(8,29): error TS2307: Cannot find module '@angular/core'.
../../../node_modules/@angular/cdk/stepper/typings/stepper.d.ts(8,107): error TS2307: Cannot find module '@angular/core'.
../../../node_modules/@angular/cdk/stepper/typings/stepper.d.ts(10,33): error TS2307: Cannot find module '@angular/forms'.
../../../node_modules/@angular/cdk/stepper/typings/stepper.d.ts(12,25): error TS2307: Cannot find module 'rxjs/Subject'.
../../../node_modules/@angular/cdk/table/typings/cell.d.ts(8,41): error TS2307: Cannot find module '@angular/core'.
../../../node_modules/@angular/cdk/table/typings/row.d.ts(8,112): error TS2307: Cannot find module '@angular/core'.
../../../node_modules/@angular/cdk/table/typings/table.d.ts(8,139): error TS2307: Cannot find module '@angular/core'.
../../../node_modules/@angular/cdk/table/typings/table.d.ts(11,33): error TS2307: Cannot find module 'rxjs/BehaviorSubject'.
../../../node_modules/@angular/cdk/table/typings/table.d.ts(13,28): error TS2307: Cannot find module 'rxjs/Observable'.
../../../node_modules/@angular/material/autocomplete/typings/autocomplete-trigger.d.ts(10,100): error TS2307: Cannot find module '@angular/core'.
../../../node_modules/@angular/material/autocomplete/typings/autocomplete-trigger.d.ts(11,38): error TS2307: Cannot find module '@angular/forms'.
../../../node_modules/@angular/material/autocomplete/typings/autocomplete-trigger.d.ts(14,28): error TS2307: Cannot find module 'rxjs/Observable'.
../../../node_modules/@angular/material/autocomplete/typings/autocomplete.d.ts(8,119): error TS2307: Cannot find module '@angular/core'.
../../../node_modules/@angular/material/button-toggle/typings/button-toggle.d.ts(10,91): error TS2307: Cannot find module '@angular/core'.
../../../node_modules/@angular/material/button-toggle/typings/button-toggle.d.ts(11,38): error TS2307: Cannot find module '@angular/forms'.
../../../node_modules/@angular/material/button/typings/button.d.ts(10,39): error TS2307: Cannot find module '@angular/core'.
../../../node_modules/@angular/material/checkbox/typings/checkbox-config.d.ts(8,32): error TS2307: Cannot find module '@angular/core'.
../../../node_modules/@angular/material/checkbox/typings/checkbox-required-validator.d.ts(8,26): error TS2307: Cannot find module '@angular/core'.
../../../node_modules/@angular/material/checkbox/typings/checkbox-required-validator.d.ts(9,43): error TS2307: Cannot find module '@angular/forms'.
../../../node_modules/@angular/material/checkbox/typings/checkbox.d.ts(9,87): error TS2307: Cannot find module '@angular/core'.
../../../node_modules/@angular/material/checkbox/typings/checkbox.d.ts(10,38): error TS2307: Cannot find module '@angular/forms'.
../../../node_modules/@angular/material/chips/typings/chip-input.d.ts(1,42): error TS2307: Cannot find module '@angular/core'.
../../../node_modules/@angular/material/chips/typings/chip-list.d.ts(11,118): error TS2307: Cannot find module '@angular/core'.
../../../node_modules/@angular/material/chips/typings/chip-list.d.ts(12,77): error TS2307: Cannot find module '@angular/forms'.
../../../node_modules/@angular/material/chips/typings/chip-list.d.ts(15,28): error TS2307: Cannot find module 'rxjs/Observable'.
../../../node_modules/@angular/material/chips/typings/chip.d.ts(9,53): error TS2307: Cannot find module '@angular/core'.
../../../node_modules/@angular/material/chips/typings/chip.d.ts(11,25): error TS2307: Cannot find module 'rxjs/Subject'.
../../../node_modules/@angular/material/core/typings/common-behaviors/color.d.ts(9,28): error TS2307: Cannot find module '@angular/core'.
../../../node_modules/@angular/material/core/typings/common-behaviors/common-module.d.ts(8,32): error TS2307: Cannot find module '@angular/core'.
../../../node_modules/@angular/material/core/typings/common-behaviors/error-state.d.ts(10,55): error TS2307: Cannot find module '@angular/forms'.
../../../node_modules/@angular/material/core/typings/common-behaviors/error-state.d.ts(11,25): error TS2307: Cannot find module 'rxjs/Subject'.
../../../node_modules/@angular/material/core/typings/common-behaviors/initialized.d.ts(9,28): error TS2307: Cannot find module 'rxjs/Observable'.
../../../node_modules/@angular/material/core/typings/datetime/date-adapter.d.ts(8,32): error TS2307: Cannot find module '@angular/core'.
../../../node_modules/@angular/material/core/typings/datetime/date-adapter.d.ts(9,28): error TS2307: Cannot find module 'rxjs/Observable'.
../../../node_modules/@angular/material/core/typings/datetime/date-adapter.d.ts(10,25): error TS2307: Cannot find module 'rxjs/Subject'.
../../../node_modules/@angular/material/core/typings/datetime/date-formats.d.ts(8,32): error TS2307: Cannot find module '@angular/core'.
../../../node_modules/@angular/material/core/typings/error/error-options.d.ts(1,57): error TS2307: Cannot find module '@angular/forms'.
../../../node_modules/@angular/material/core/typings/gestures/gesture-config.d.ts(8,32): error TS2307: Cannot find module '@angular/core'.
../../../node_modules/@angular/material/core/typings/gestures/gesture-config.d.ts(9,37): error TS2307: Cannot find module '@angular/platform-browser'.
../../../node_modules/@angular/material/core/typings/label/label-options.d.ts(8,32): error TS2307: Cannot find module '@angular/core'.
../../../node_modules/@angular/material/core/typings/line/line.d.ts(8,39): error TS2307: Cannot find module '@angular/core'.
../../../node_modules/@angular/material/core/typings/option/option.d.ts(1,25): error TS2307: Cannot find module 'rxjs/Subject'.
../../../node_modules/@angular/material/core/typings/option/option.d.ts(2,106): error TS2307: Cannot find module '@angular/core'.
../../../node_modules/@angular/material/core/typings/ripple/ripple-renderer.d.ts(8,36): error TS2307: Cannot find module '@angular/core'.
../../../node_modules/@angular/material/core/typings/ripple/ripple.d.ts(9,71): error TS2307: Cannot find module '@angular/core'.
../../../node_modules/@angular/material/datepicker/typings/calendar-body.d.ts(8,30): error TS2307: Cannot find module '@angular/core'.
../../../node_modules/@angular/material/datepicker/typings/calendar.d.ts(1,124): error TS2307: Cannot find module '@angular/core'.
../../../node_modules/@angular/material/datepicker/typings/datepicker-input.d.ts(1,71): error TS2307: Cannot find module '@angular/core'.
../../../node_modules/@angular/material/datepicker/typings/datepicker-input.d.ts(2,84): error TS2307: Cannot find module '@angular/forms'.
../../../node_modules/@angular/material/datepicker/typings/datepicker-intl.d.ts(1,25): error TS2307: Cannot find module 'rxjs/Subject'.
../../../node_modules/@angular/material/datepicker/typings/datepicker-toggle.d.ts(1,90): error TS2307: Cannot find module '@angular/core'.
../../../node_modules/@angular/material/datepicker/typings/datepicker.d.ts(10,101): error TS2307: Cannot find module '@angular/core'.
../../../node_modules/@angular/material/datepicker/typings/datepicker.d.ts(13,25): error TS2307: Cannot find module 'rxjs/Subject'.
../../../node_modules/@angular/material/datepicker/typings/month-view.d.ts(8,67): error TS2307: Cannot find module '@angular/core'.
../../../node_modules/@angular/material/datepicker/typings/multi-year-view.d.ts(8,67): error TS2307: Cannot find module '@angular/core'.
../../../node_modules/@angular/material/datepicker/typings/year-view.d.ts(8,67): error TS2307: Cannot find module '@angular/core'.
../../../node_modules/@angular/material/dialog/typings/dialog-animations.d.ts(8,42): error TS2307: Cannot find module '@angular/animations'.
../../../node_modules/@angular/material/dialog/typings/dialog-config.d.ts(8,34): error TS2307: Cannot find module '@angular/core'.
../../../node_modules/@angular/material/dialog/typings/dialog-container.d.ts(8,92): error TS2307: Cannot find module '@angular/core'.
../../../node_modules/@angular/material/dialog/typings/dialog-container.d.ts(9,32): error TS2307: Cannot find module '@angular/animations'.
../../../node_modules/@angular/material/dialog/typings/dialog-content-directives.d.ts(8,62): error TS2307: Cannot find module '@angular/core'.
../../../node_modules/@angular/material/dialog/typings/dialog-ref.d.ts(9,26): error TS2307: Cannot find module '@angular/common'.
../../../node_modules/@angular/material/dialog/typings/dialog-ref.d.ts(11,28): error TS2307: Cannot find module 'rxjs/Observable'.
../../../node_modules/@angular/material/dialog/typings/dialog.d.ts(3,26): error TS2307: Cannot find module '@angular/common'.
../../../node_modules/@angular/material/dialog/typings/dialog.d.ts(4,55): error TS2307: Cannot find module '@angular/core'.
../../../node_modules/@angular/material/dialog/typings/dialog.d.ts(5,28): error TS2307: Cannot find module 'rxjs/Observable'.
../../../node_modules/@angular/material/dialog/typings/dialog.d.ts(6,25): error TS2307: Cannot find module 'rxjs/Subject'.
../../../node_modules/@angular/material/expansion/typings/expansion-animations.d.ts(8,42): error TS2307: Cannot find module '@angular/animations'.
../../../node_modules/@angular/material/expansion/typings/expansion-panel-content.d.ts(8,29): error TS2307: Cannot find module '@angular/core'.
../../../node_modules/@angular/material/expansion/typings/expansion-panel-header.d.ts(9,58): error TS2307: Cannot find module '@angular/core'.
../../../node_modules/@angular/material/expansion/typings/expansion-panel.d.ts(8,32): error TS2307: Cannot find module '@angular/animations'.
../../../node_modules/@angular/material/expansion/typings/expansion-panel.d.ts(9,108): error TS2307: Cannot find module '@angular/core'.
../../../node_modules/@angular/material/expansion/typings/expansion-panel.d.ts(13,25): error TS2307: Cannot find module 'rxjs/Subject'.
../../../node_modules/@angular/material/form-field/typings/form-field-animations.d.ts(8,42): error TS2307: Cannot find module '@angular/animations'.
../../../node_modules/@angular/material/form-field/typings/form-field-control.d.ts(8,28): error TS2307: Cannot find module 'rxjs/Observable'.
../../../node_modules/@angular/material/form-field/typings/form-field-control.d.ts(9,27): error TS2307: Cannot find module '@angular/forms'.
../../../node_modules/@angular/material/form-field/typings/form-field.d.ts(1,112): error TS2307: Cannot find module '@angular/core'.
../../../node_modules/@angular/material/grid-list/typings/grid-list.d.ts(8,68): error TS2307: Cannot find module '@angular/core'.
../../../node_modules/@angular/material/grid-list/typings/grid-tile.d.ts(8,57): error TS2307: Cannot find module '@angular/core'.
../../../node_modules/@angular/material/icon/typings/icon-registry.d.ts(1,26): error TS2307: Cannot find module '@angular/core'.
../../../node_modules/@angular/material/icon/typings/icon-registry.d.ts(2,28): error TS2307: Cannot find module '@angular/common/http'.
../../../node_modules/@angular/material/icon/typings/icon-registry.d.ts(3,47): error TS2307: Cannot find module '@angular/platform-browser'.
../../../node_modules/@angular/material/icon/typings/icon-registry.d.ts(4,28): error TS2307: Cannot find module 'rxjs/Observable'.
../../../node_modules/@angular/material/icon/typings/icon.d.ts(1,62): error TS2307: Cannot find module '@angular/core'.
../../../node_modules/@angular/material/input/typings/autosize.d.ts(8,71): error TS2307: Cannot find module '@angular/core'.
../../../node_modules/@angular/material/input/typings/input-value-accessor.d.ts(8,32): error TS2307: Cannot find module '@angular/core'.
../../../node_modules/@angular/material/input/typings/input.d.ts(2,59): error TS2307: Cannot find module '@angular/core'.
../../../node_modules/@angular/material/input/typings/input.d.ts(3,55): error TS2307: Cannot find module '@angular/forms'.
../../../node_modules/@angular/material/input/typings/input.d.ts(6,25): error TS2307: Cannot find module 'rxjs/Subject'.
../../../node_modules/@angular/material/list/typings/list.d.ts(8,57): error TS2307: Cannot find module '@angular/core'.
../../../node_modules/@angular/material/list/typings/selection-list.d.ts(10,109): error TS2307: Cannot find module '@angular/core'.
../../../node_modules/@angular/material/list/typings/selection-list.d.ts(12,38): error TS2307: Cannot find module '@angular/forms'.
../../../node_modules/@angular/material/menu/typings/menu-animations.d.ts(8,42): error TS2307: Cannot find module '@angular/animations'.
../../../node_modules/@angular/material/menu/typings/menu-content.d.ts(8,110): error TS2307: Cannot find module '@angular/core'.
../../../node_modules/@angular/material/menu/typings/menu-directive.d.ts(8,32): error TS2307: Cannot find module '@angular/animations'.
../../../node_modules/@angular/material/menu/typings/menu-directive.d.ts(10,119): error TS2307: Cannot find module '@angular/core'.
../../../node_modules/@angular/material/menu/typings/menu-directive.d.ts(11,28): error TS2307: Cannot find module 'rxjs/Observable'.
../../../node_modules/@angular/material/menu/typings/menu-item.d.ts(9,39): error TS2307: Cannot find module '@angular/core'.
../../../node_modules/@angular/material/menu/typings/menu-item.d.ts(11,25): error TS2307: Cannot find module 'rxjs/Subject'.
../../../node_modules/@angular/material/menu/typings/menu-panel.d.ts(8,43): error TS2307: Cannot find module '@angular/core'.
../../../node_modules/@angular/material/menu/typings/menu-trigger.d.ts(3,105): error TS2307: Cannot find module '@angular/core'.
../../../node_modules/@angular/material/paginator/typings/paginator-intl.d.ts(8,26): error TS2307: Cannot find module '@angular/core'.
../../../node_modules/@angular/material/paginator/typings/paginator-intl.d.ts(9,25): error TS2307: Cannot find module 'rxjs/Subject'.
../../../node_modules/@angular/material/paginator/typings/paginator.d.ts(1,68): error TS2307: Cannot find module '@angular/core'.
../../../node_modules/@angular/material/progress-bar/typings/progress-bar.d.ts(8,28): error TS2307: Cannot find module '@angular/core'.
../../../node_modules/@angular/material/progress-spinner/typings/progress-spinner.d.ts(8,54): error TS2307: Cannot find module '@angular/core'.
../../../node_modules/@angular/material/radio/typings/radio.d.ts(10,124): error TS2307: Cannot find module '@angular/core'.
../../../node_modules/@angular/material/radio/typings/radio.d.ts(11,38): error TS2307: Cannot find module '@angular/forms'.
../../../node_modules/@angular/material/select/typings/select-animations.d.ts(8,42): error TS2307: Cannot find module '@angular/animations'.
../../../node_modules/@angular/material/select/typings/select.d.ts(12,168): error TS2307: Cannot find module '@angular/core'.
../../../node_modules/@angular/material/select/typings/select.d.ts(13,77): error TS2307: Cannot find module '@angular/forms'.
../../../node_modules/@angular/material/select/typings/select.d.ts(16,28): error TS2307: Cannot find module 'rxjs/Observable'.
../../../node_modules/@angular/material/sidenav/typings/drawer-animations.d.ts(8,42): error TS2307: Cannot find module '@angular/animations'.
../../../node_modules/@angular/material/sidenav/typings/drawer.d.ts(8,32): error TS2307: Cannot find module '@angular/animations'.
../../../node_modules/@angular/material/sidenav/typings/drawer.d.ts(12,146): error TS2307: Cannot find module '@angular/core'.
../../../node_modules/@angular/material/sidenav/typings/drawer.d.ts(13,25): error TS2307: Cannot find module 'rxjs/Subject'.
../../../node_modules/@angular/material/sidenav/typings/drawer.d.ts(14,28): error TS2307: Cannot find module 'rxjs/Observable'.
../../../node_modules/@angular/material/sidenav/typings/sidenav.d.ts(8,46): error TS2307: Cannot find module '@angular/core'.
../../../node_modules/@angular/material/slide-toggle/typings/slide-toggle.d.ts(10,90): error TS2307: Cannot find module '@angular/core'.
../../../node_modules/@angular/material/slide-toggle/typings/slide-toggle.d.ts(11,38): error TS2307: Cannot find module '@angular/forms'.
../../../node_modules/@angular/material/slider/typings/slider.d.ts(10,80): error TS2307: Cannot find module '@angular/core'.
../../../node_modules/@angular/material/slider/typings/slider.d.ts(11,38): error TS2307: Cannot find module '@angular/forms'.
../../../node_modules/@angular/material/snack-bar/typings/snack-bar-animations.d.ts(8,42): error TS2307: Cannot find module '@angular/animations'.
../../../node_modules/@angular/material/snack-bar/typings/snack-bar-config.d.ts(8,50): error TS2307: Cannot find module '@angular/core'.
../../../node_modules/@angular/material/snack-bar/typings/snack-bar-container.d.ts(8,97): error TS2307: Cannot find module '@angular/core'.
../../../node_modules/@angular/material/snack-bar/typings/snack-bar-container.d.ts(9,32): error TS2307: Cannot find module '@angular/animations'.
../../../node_modules/@angular/material/snack-bar/typings/snack-bar-container.d.ts(11,28): error TS2307: Cannot find module 'rxjs/Observable'.
../../../node_modules/@angular/material/snack-bar/typings/snack-bar-container.d.ts(12,25): error TS2307: Cannot find module 'rxjs/Subject'.
../../../node_modules/@angular/material/snack-bar/typings/snack-bar-ref.d.ts(9,28): error TS2307: Cannot find module 'rxjs/Observable'.
../../../node_modules/@angular/material/snack-bar/typings/snack-bar.d.ts(12,26): error TS2307: Cannot find module '@angular/core'.
../../../node_modules/@angular/material/sort/typings/sort-animations.d.ts(8,42): error TS2307: Cannot find module '@angular/animations'.
../../../node_modules/@angular/material/sort/typings/sort-header-intl.d.ts(8,26): error TS2307: Cannot find module '@angular/core'.
../../../node_modules/@angular/material/sort/typings/sort-header-intl.d.ts(9,25): error TS2307: Cannot find module 'rxjs/Subject'.
../../../node_modules/@angular/material/sort/typings/sort-header.d.ts(8,35): error TS2307: Cannot find module '@angular/core'.
../../../node_modules/@angular/material/sort/typings/sort.d.ts(8,52): error TS2307: Cannot find module '@angular/core'.
../../../node_modules/@angular/material/sort/typings/sort.d.ts(11,25): error TS2307: Cannot find module 'rxjs/Subject'.
../../../node_modules/@angular/material/stepper/typings/step-header.d.ts(9,71): error TS2307: Cannot find module '@angular/core'.
../../../node_modules/@angular/material/stepper/typings/step-label.d.ts(8,29): error TS2307: Cannot find module '@angular/core'.
../../../node_modules/@angular/material/stepper/typings/stepper-animations.d.ts(8,42): error TS2307: Cannot find module '@angular/animations'.
../../../node_modules/@angular/material/stepper/typings/stepper-icon.d.ts(8,29): error TS2307: Cannot find module '@angular/core'.
../../../node_modules/@angular/material/stepper/typings/stepper-intl.d.ts(1,25): error TS2307: Cannot find module 'rxjs/Subject'.
../../../node_modules/@angular/material/stepper/typings/stepper.d.ts(10,89): error TS2307: Cannot find module '@angular/core'.
../../../node_modules/@angular/material/stepper/typings/stepper.d.ts(11,57): error TS2307: Cannot find module '@angular/forms'.
../../../node_modules/@angular/material/table/typings/cell.d.ts(8,28): error TS2307: Cannot find module '@angular/core'.
../../../node_modules/@angular/material/table/typings/table-data-source.d.ts(9,33): error TS2307: Cannot find module 'rxjs/BehaviorSubject'.
../../../node_modules/@angular/material/table/typings/table-data-source.d.ts(12,30): error TS2307: Cannot find module 'rxjs/Subscription'.
../../../node_modules/@angular/material/tabs/typings/ink-bar.d.ts(8,36): error TS2307: Cannot find module '@angular/core'.
../../../node_modules/@angular/material/tabs/typings/tab-body.d.ts(8,105): error TS2307: Cannot find module '@angular/core'.
../../../node_modules/@angular/material/tabs/typings/tab-body.d.ts(9,32): error TS2307: Cannot find module '@angular/animations'.
../../../node_modules/@angular/material/tabs/typings/tab-group.d.ts(8,122): error TS2307: Cannot find module '@angular/core'.
../../../node_modules/@angular/material/tabs/typings/tab-header.d.ts(9,122): error TS2307: Cannot find module '@angular/core'.
../../../node_modules/@angular/material/tabs/typings/tab-label-wrapper.d.ts(8,28): error TS2307: Cannot find module '@angular/core'.
../../../node_modules/@angular/material/tabs/typings/tab-label.d.ts(8,47): error TS2307: Cannot find module '@angular/core'.
../../../node_modules/@angular/material/tabs/typings/tab-nav-bar/tab-nav-bar.d.ts(11,95): error TS2307: Cannot find module '@angular/core'.
../../../node_modules/@angular/material/tabs/typings/tab.d.ts(9,92): error TS2307: Cannot find module '@angular/core'.
../../../node_modules/@angular/material/tabs/typings/tab.d.ts(11,25): error TS2307: Cannot find module 'rxjs/Subject'.
../../../node_modules/@angular/material/tabs/typings/tabs-animations.d.ts(8,42): error TS2307: Cannot find module '@angular/animations'.
../../../node_modules/@angular/material/toolbar/typings/toolbar.d.ts(8,54): error TS2307: Cannot find module '@angular/core'.
../../../node_modules/@angular/material/tooltip/typings/tooltip-animations.d.ts(8,42): error TS2307: Cannot find module '@angular/animations'.
../../../node_modules/@angular/material/tooltip/typings/tooltip.d.ts(8,32): error TS2307: Cannot find module '@angular/animations'.
../../../node_modules/@angular/material/tooltip/typings/tooltip.d.ts(14,100): error TS2307: Cannot find module '@angular/core'.
../../../node_modules/@angular/material/tooltip/typings/tooltip.d.ts(15,28): error TS2307: Cannot find module 'rxjs/Observable'.
../../../node_modules/@angular/material/typings/version.d.ts(8,25): error TS2307: Cannot find module '@angular/core'.

我对此一无所知。有人能帮帮我吗?
package.json:https://pastebin.com/GzfVg1cs

gywdnpxw

gywdnpxw1#

为了解决此问题,您必须更新到Angular CLI版本,因为@angular cdk 6.0需要@angular core 6.0 version(更新版本)。请尝试对CLI和Material/CDK使用更新版本
请按照以下步骤操作:

npm uninstall -g @angular/cli
npm cache verify

如果npm版本小于5,则使用npm cache clean

npm install -g @angular/cli@latest

然后在安装@angular/material@angular/cdk之后创建新的angluar/cli项目。
我希望这能解决你的问题。

zy1mlcev

zy1mlcev2#

对我来说,当我确保@angular/material@angular/ckd@angular/animations版本与@angular/core版本兼容时,问题得到了解决。只需编辑package.json
在我的例子中:

"@angular/core": "^7.2.15",
"@angular/animations": "^7.2.15",
"@angular/material": "^7.3.3",
"@angular/cdk": "^7.3.7",
fkvaft9z

fkvaft9z3#

1.以管理员身份打开cmd
1.检查是否安装了@angular/cdk
Angular /芯处的npm ls
1.如果未安装,请运行以下命令
Angular /cdk时的npm安装

  1. npm安装
  2. npm安装-g@Angular /cli@最新

lxkprmvk

lxkprmvk4#

运行npm安装
重新启动Visual Studio

unhi4e5o

unhi4e5o5#

这个问题很明显是由Angular 的CDK和材质模块引起的。我不知道它是怎么发生的,但是我修复了它。
我通过以下github问题中的一个答案修复了它:https://github.com/angular/material2/issues/8306

    • 解决方案**

要解决此问题,您必须运行以下命令:

npm install --save @angular/material @angular/cdk
rm -rf node_modules
npm install
vc9ivgsu

vc9ivgsu6#

我看到有些解决方案是激进的,我一开始就不会去尝试。我的解决方案并不激进,而且它确实起到了作用。
我也遇到了这个问题,我做了一个简单的npm update这是什么出来:

$> npm update
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.4 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.4: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

+ rxjs@6.2.2
+ core-js@2.5.7
added 2 packages from 6 contributors and audited 38996 packages in 13.315s
found 0 vulnerabilities

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.2.4 (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.2.4: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

+ @types/jasminewd2@2.0.4
updated 1 package and audited 38996 packages in 12.972s
found 0 vulnerabilities

而且它解决了问题。

相关问题