Мой проект, использующий Angle CLI 1.7.4, какую версию Angular Material будет правильной для установки? - PullRequest
0 голосов
/ 18 декабря 2018

Мой проект построен на Angular CLI 1.7.4 При выполнении команды "ng serve" я получаю следующие ошибки: Я понимаю, что это связано с тем, что угловой материал отсутствует в проекте.Пожалуйста, подскажите мне, какая угловая версия материала лучше всего подойдет для моего проекта. Пожалуйста, найдите сообщения об ошибках ниже:

ERROR in node_modules/@angular/flex-layout/flex/typings/flex-offset/flex-offset.d.ts(9,32): error TS2307: Cannot find module '@angular/cdk/bidi'.
node_modules/@angular/flex-layout/flex/typings/layout-gap/layout-gap.d.ts(9,32): error TS2307: Cannot find module '@angular/cdk/bidi'.
node_modules/@angular/material/autocomplete/typings/autocomplete-trigger.d.ts(8,32): error TS2307: Cannot find module '@angular/cdk/bidi'.
node_modules/@angular/material/autocomplete/typings/autocomplete-trigger.d.ts(9,41): error TS2307: Cannot find module '@angular/cdk/overlay'.
node_modules/@angular/material/autocomplete/typings/autocomplete.d.ts(10,44): error TS2307: Cannot find module '@angular/cdk/a11y'.
node_modules/@angular/material/button-toggle/typings/button-toggle.d.ts(8,30): error TS2307: Cannot find module '@angular/cdk/a11y'.
node_modules/@angular/material/button-toggle/typings/button-toggle.d.ts(9,43): error TS2307: Cannot find module '@angular/cdk/collections'.
node_modules/@angular/material/button/typings/button.d.ts(8,30): error TS2307: Cannot find module '@angular/cdk/a11y'.
node_modules/@angular/material/button/typings/button.d.ts(9,26): error TS2307: Cannot find module '@angular/cdk/platform'.
node_modules/@angular/material/checkbox/typings/checkbox.d.ts(8,30): error TS2307: Cannot find module '@angular/cdk/a11y'.
node_modules/@angular/material/chips/typings/chip-list.d.ts(8,33): error TS2307: Cannot find module '@angular/cdk/a11y'.node_modules/@angular/material/chips/typings/chip-list.d.ts(9,32): error TS2307: Cannot find module '@angular/cdk/bidi'.node_modules/@angular/material/chips/typings/chip-list.d.ts(10,32): error TS2307: Cannot find module '@angular/cdk/collections'.
node_modules/@angular/material/chips/typings/chip.d.ts(8,33): error TS2307: Cannot find module '@angular/cdk/a11y'.
node_modules/@angular/material/core/typings/ripple/ripple-renderer.d.ts(9,26): error TS2307: Cannot find module '@angular/cdk/platform'.
node_modules/@angular/material/core/typings/ripple/ripple.d.ts(8,26): error TS2307: Cannot find module '@angular/cdk/platform'.
node_modules/@angular/material/datepicker/typings/calendar.d.ts(7,32): error TS2307: Cannot find module '@angular/cdk/bidi'.
node_modules/@angular/material/datepicker/typings/datepicker.d.ts(8,32): error TS2307: Cannot find module '@angular/cdk/bidi'.
node_modules/@angular/material/datepicker/typings/datepicker.d.ts(9,67): error TS2307: Cannot find module '@angular/cdk/overlay'.
node_modules/@angular/material/dialog/typings/dialog-config.d.ts(9,27): error TS2307: Cannot find module '@angular/cdk/bidi'.
node_modules/@angular/material/dialog/typings/dialog-config.d.ts(10,32): error TS2307: Cannot find module '@angular/cdk/overlay'.
node_modules/@angular/material/dialog/typings/dialog-container.d.ts(10,84): error TS2307: Cannot find module '@angular/cdk/portal'.
node_modules/@angular/material/dialog/typings/dialog-container.d.ts(11,34): error TS2307: Cannot find module '@angular/cdk/a11y'.
node_modules/@angular/material/dialog/typings/dialog-ref.d.ts(8,28): error TS2307: Cannot find module '@angular/cdk/overlay'.
node_modules/@angular/material/dialog/typings/dialog.d.ts(1,59): error TS2307: Cannot find module '@angular/cdk/overlay'.
node_modules/@angular/material/dialog/typings/dialog.d.ts(2,31): error TS2307: Cannot find module '@angular/cdk/portal'.node_modules/@angular/material/expansion/typings/accordion.d.ts(1,30): error TS2307: Cannot find module '@angular/cdk/accordion'.
node_modules/@angular/material/expansion/typings/expansion-panel-header.d.ts(8,30): error TS2307: Cannot find module '@angular/cdk/a11y'.
node_modules/@angular/material/expansion/typings/expansion-panel.d.ts(10,34): error TS2307: Cannot find module '@angular/cdk/accordion'.
node_modules/@angular/material/expansion/typings/expansion-panel.d.ts(11,43): error TS2307: Cannot find module '@angular/cdk/collections'.
node_modules/@angular/material/expansion/typings/expansion-panel.d.ts(12,32): error TS2307: Cannot find module '@angular/cdk/portal'.
node_modules/@angular/material/grid-list/typings/grid-list.d.ts(10,32): error TS2307: Cannot find module '@angular/cdk/bidi'.
node_modules/@angular/material/input/typings/autosize.d.ts(9,26): error TS2307: Cannot find module '@angular/cdk/platform'.
node_modules/@angular/material/input/typings/input.d.ts(1,26): error TS2307: Cannot find module '@angular/cdk/platform'.node_modules/@angular/material/list/typings/selection-list.d.ts(8,50): error TS2307: Cannot find module '@angular/cdk/a11y'.
node_modules/@angular/material/list/typings/selection-list.d.ts(9,32): error TS2307: Cannot find module '@angular/cdk/collections'.
node_modules/@angular/material/menu/typings/menu-directive.d.ts(9,27): error TS2307: Cannot find module '@angular/cdk/bidi'.
node_modules/@angular/material/menu/typings/menu-directive.d.ts(16,29): error TS2307: Cannot find module '@angular/cdk/a11y'.
node_modules/@angular/material/menu/typings/menu-item.d.ts(8,60): error TS2307: Cannot find module '@angular/cdk/a11y'.
node_modules/@angular/material/menu/typings/menu-panel.d.ts(10,27): error TS2307: Cannot find module '@angular/cdk/bidi'.
node_modules/@angular/material/menu/typings/menu-panel.d.ts(11,29): error TS2307: Cannot find module '@angular/cdk/a11y'.
node_modules/@angular/material/menu/typings/menu-trigger.d.ts(1,43): error TS2307: Cannot find module '@angular/cdk/bidi'.
node_modules/@angular/material/menu/typings/menu-trigger.d.ts(2,67): error TS2307: Cannot find module '@angular/cdk/overlay'.
node_modules/@angular/material/menu/typings/menu-trigger.d.ts(7,43): error TS2307: Cannot find module '@angular/cdk/a11y'.
node_modules/@angular/material/progress-spinner/typings/progress-spinner.d.ts(10,26): error TS2307: Cannot find module '@angular/cdk/platform'.
node_modules/@angular/material/radio/typings/radio.d.ts(8,30): error TS2307: Cannot find module '@angular/cdk/a11y'.
node_modules/@angular/material/radio/typings/radio.d.ts(9,43): error TS2307: Cannot find module '@angular/cdk/collections'.
node_modules/@angular/material/select/typings/select.d.ts(8,44): error TS2307: Cannot find module '@angular/cdk/a11y'.
node_modules/@angular/material/select/typings/select.d.ts(9,32): error TS2307: Cannot find module '@angular/cdk/bidi'.
node_modules/@angular/material/select/typings/select.d.ts(10,32): error TS2307: Cannot find module '@angular/cdk/collections'.
node_modules/@angular/material/select/typings/select.d.ts(11,103): error TS2307: Cannot find module '@angular/cdk/overlay'.
node_modules/@angular/material/sidenav/typings/drawer.d.ts(9,61): error TS2307: Cannot find module '@angular/cdk/a11y'.
node_modules/@angular/material/sidenav/typings/drawer.d.ts(10,32): error TS2307: Cannot find module '@angular/cdk/bidi'.node_modules/@angular/material/sidenav/typings/drawer.d.ts(11,26): error TS2307: Cannot find module '@angular/cdk/platform'.
node_modules/@angular/material/sidenav/typings/drawer.d.ts(15,31): error TS2307: Cannot find module '@angular/cdk/scrolling'.
node_modules/@angular/material/slide-toggle/typings/slide-toggle.d.ts(8,30): error TS2307: Cannot find module '@angular/cdk/a11y'.
node_modules/@angular/material/slide-toggle/typings/slide-toggle.d.ts(9,26): error TS2307: Cannot find module '@angular/cdk/platform'.
node_modules/@angular/material/slider/typings/slider.d.ts(8,30): error TS2307: Cannot find module '@angular/cdk/a11y'.
node_modules/@angular/material/slider/typings/slider.d.ts(9,32): error TS2307: Cannot find module '@angular/cdk/bidi'.
node_modules/@angular/material/snack-bar/typings/snack-bar-config.d.ts(9,36): error TS2307: Cannot find module '@angular/cdk/a11y'.
node_modules/@angular/material/snack-bar/typings/snack-bar-config.d.ts(10,27): error TS2307: Cannot find module '@angular/cdk/bidi'.
node_modules/@angular/material/snack-bar/typings/snack-bar-container.d.ts(10,68): error TS2307: Cannot find module '@angular/cdk/portal'.
node_modules/@angular/material/snack-bar/typings/snack-bar-ref.d.ts(8,28): error TS2307: Cannot find module '@angular/cdk/overlay'.
node_modules/@angular/material/snack-bar/typings/snack-bar.d.ts(8,31): error TS2307: Cannot find module '@angular/cdk/a11y'.
node_modules/@angular/material/snack-bar/typings/snack-bar.d.ts(9,36): error TS2307: Cannot find module '@angular/cdk/layout'.
node_modules/@angular/material/snack-bar/typings/snack-bar.d.ts(10,25): error TS2307: Cannot find module '@angular/cdk/overlay'.
node_modules/@angular/material/snack-bar/typings/snack-bar.d.ts(11,31): error TS2307: Cannot find module '@angular/cdk/portal'.
node_modules/@angular/material/sort/typings/sort-header.d.ts(9,30): error TS2307: Cannot find module '@angular/cdk/table'.
node_modules/@angular/material/stepper/typings/step-header.d.ts(8,30): error TS2307: Cannot find module '@angular/cdk/a11y'.
node_modules/@angular/material/stepper/typings/step-label.d.ts(9,30): error TS2307: Cannot find module '@angular/cdk/stepper'.
node_modules/@angular/material/stepper/typings/stepper-button.d.ts(1,52): error TS2307: Cannot find module '@angular/cdk/stepper'.
node_modules/@angular/material/stepper/typings/stepper.d.ts(8,37): error TS2307: Cannot find module '@angular/cdk/stepper'.
node_modules/@angular/material/stepper/typings/stepper.d.ts(9,32): error TS2307: Cannot find module '@angular/cdk/bidi'.node_modules/@angular/material/table/typings/cell.d.ts(9,84): error TS2307: Cannot find module '@angular/cdk/table'.
node_modules/@angular/material/table/typings/row.d.ts(1,66): error TS2307: Cannot find module '@angular/cdk/table'.
node_modules/@angular/material/table/typings/table-data-source.d.ts(8,28): error TS2307: Cannot find module '@angular/cdk/table'.
node_modules/@angular/material/table/typings/table.d.ts(1,26): error TS2307: Cannot find module '@angular/cdk/table'.
node_modules/@angular/material/tabs/typings/tab-body.d.ts(10,49): error TS2307: Cannot find module '@angular/cdk/portal'.
node_modules/@angular/material/tabs/typings/tab-body.d.ts(11,43): error TS2307: Cannot find module '@angular/cdk/bidi'.
node_modules/@angular/material/tabs/typings/tab-header.d.ts(8,43): error TS2307: Cannot find module '@angular/cdk/bidi'.node_modules/@angular/material/tabs/typings/tab-header.d.ts(13,31): error TS2307: Cannot find module '@angular/cdk/scrolling'.
node_modules/@angular/material/tabs/typings/tab-label.d.ts(9,27): error TS2307: Cannot find module '@angular/cdk/portal'.
node_modules/@angular/material/tabs/typings/tab-nav-bar/tab-nav-bar.d.ts(8,32): error TS2307: Cannot find module '@angular/cdk/bidi'.
node_modules/@angular/material/tabs/typings/tab-nav-bar/tab-nav-bar.d.ts(9,26): error TS2307: Cannot find module '@angular/cdk/platform'.
node_modules/@angular/material/tabs/typings/tab-nav-bar/tab-nav-bar.d.ts(10,31): error TS2307: Cannot find module '@angular/cdk/scrolling'.
node_modules/@angular/material/tabs/typings/tab.d.ts(8,32): error TS2307: Cannot find module '@angular/cdk/portal'.
node_modules/@angular/material/toolbar/typings/toolbar.d.ts(10,26): error TS2307: Cannot find module '@angular/cdk/platform'.
node_modules/@angular/material/tooltip/typings/tooltip.d.ts(9,45): error TS2307: Cannot find module '@angular/cdk/a11y'.node_modules/@angular/material/tooltip/typings/tooltip.d.ts(10,32): error TS2307: Cannot find module '@angular/cdk/bidi'.
node_modules/@angular/material/tooltip/typings/tooltip.d.ts(11,156): error TS2307: Cannot find module '@angular/cdk/overlay'.
node_modules/@angular/material/tooltip/typings/tooltip.d.ts(12,26): error TS2307: Cannot find module '@angular/cdk/platform'.
node_modules/@angular/material/tooltip/typings/tooltip.d.ts(13,34): error TS2307: Cannot find module '@angular/cdk/scrolling'.
node_modules/@angular/material/tooltip/typings/tooltip.d.ts(16,53): error TS2307: Cannot find module '@angular/cdk/layout'.
src/app/components/job-execution-report/job-execution-report.component.ts(19,26): error TS2307: Cannot find module '@angular/cdk/collections'.
src/app/components/job-execution-report/tasks-details-dialog.component.ts(3,26): error TS2307: Cannot find module '@angular/cdk/collections'.
src/app/components/job-summay-dialog/list-jobs.dialog.component.ts(9,26): error TS2307: Cannot find module '@angular/cdk/collections'.
src/app/components/list-jobs/list-jobs.component.ts(10,26): error TS2307: Cannot find module '@angular/cdk/collections'.src/app/components/list-tasks/list-tasks.component.ts(20,26): error TS2307: Cannot find module '@angular/cdk/collections'.
src/app/components/list-tasks/list-tasks.component.ts(21,21): error TS2307: Cannot find module '@angular/cdk/keycodes'.
src/app/components/list-tasks/list-tasks.dialog.component.ts(7,26): error TS2307: Cannot find module '@angular/cdk/collections'.
src/app/components/list-workflows/list-workflows-dialog.component.ts(4,26): error TS2307: Cannot find module '@angular/cdk/collections'.
src/app/components/list-workflows/list-workflows.component.ts(11,26): error TS2307: Cannot find module '@angular/cdk/collections'.
src/app/components/my-approvals/my-approvals.component.ts(11,26): error TS2307: Cannot find module '@angular/cdk/collections'.
src/app/components/my-team-requests/my-team-requests.component.ts(9,26): error TS2307: Cannot find module '@angular/cdk/collections'.
src/app/components/pending-scheduled-jobs/pending-scheduled-jobs.component.ts(10,26): error TS2307: Cannot find module '@angular/cdk/collections'.
src/app/components/profile/profile.component.ts(9,26): error TS2307: Cannot find module '@angular/cdk/collections'.
src/app/components/rfc-executions-report/rfc-execution-report.component.ts(4,26): error TS2307: Cannot find module '@angular/cdk/collections'.
src/app/components/run-summary-dialog/run-summary-dialog.component.ts(3,26): error TS2307: Cannot find module '@angular/cdk/collections'.
src/app/components/schedule-job/runtime-pause-config-dialog.component.ts(5,26): error TS2307: Cannot find module '@angular/cdk/collections'.
src/app/components/schedule-job/schedule-job.component.ts(1186,81): error TS2339: Property 'taskArgsValuesObj' does not exist on type '{}'.
src/app/components/team-requests/team-requests.component.ts(11,26): error TS2307: Cannot find module '@angular/cdk/collections'.
src/app/components/team-security/team-security.component.ts(15,26): error TS2307: Cannot find module '@angular/cdk/collections'.
src/app/modules/atom-ng-material.module.ts(33,30): error TS2307: Cannot find module '@angular/cdk/table'.


webpack: Failed to compile.

Ответы [ 3 ]

0 голосов
/ 18 декабря 2018

вам просто нужно установить

npm install --save @angular/material@latest @angular/cdk@latest

не беспокойтесь о версии, которую он установит последней, и о той же версии.

0 голосов
/ 19 декабря 2018

Изначально мой глобальный CLI был самым последним (7.1), а моя локальная версия CLI - в 5.

Установка глобальной и локальной CLI угловой версии CLI 5 решила проблему.

Попробуйте следующий комментарий:

npm uninstall @angular/cli

npm install -g @angular/cli@5.2.5
0 голосов
/ 18 декабря 2018
  1. Сначала попробуйте

npm install

, чтобы установить все модули, необходимые внутри package.json.

Попробуйте

ng -v

, чтобы проверить свою версию Angular

Вы должны проверить свою версию Angular вместо версии CLI, чтобыпроверьте, какую версию Angular Material вы должны установить.

Перейдите по этой https://material.angular.io/, чтобы узнать, какую версию Angular Material вы должны установить.

Следующая команда обновит ваш Angular проект с правильными зависимостями, выполнит изменения конфигурации и выполнит код инициализации.

ng add @ angular / material

С Angular 5 вы можете использовать угловой материал 5. Выполните следующие команды для установки версий 5.2.5 @ angular / material и @ angular / cdk:

npm install --save @angular/material@5.2.5 
npm install --save @angular/cdk@5.2.5

Angular Materialверсия для приложения 5 angular

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...