Я получаю эту ошибку:
ERROR in node_modules/@angular/material/autocomplete/typings/autocomplete-trigger.d.ts(28,77): error TS2709: Cannot use namespace 'ScrollStrategy' as a type.
node_modules/@angular/material/autocomplete/typings/autocomplete-trigger.d.ts(30,75): error TS2709: Cannot use namespace 'Overlay' as a type.
node_modules/@angular/material/autocomplete/typings/autocomplete-trigger.d.ts(30,91): error TS2709: Cannot use namespace 'ScrollStrategy' as a type.
node_modules/@angular/material/autocomplete/typings/autocomplete-trigger.d.ts(33,35): error TS2709: Cannot use namespace 'ScrollStrategy' as a type.
node_modules/@angular/material/autocomplete/typings/autocomplete-trigger.d.ts(106,67): error TS2709: Cannot use namespace 'Overlay' as a type.
node_modules/@angular/material/autocomplete/typings/autocomplete-trigger.d.ts(106,194): error TS2709: Cannot use namespace 'Directionality' as a type.
node_modules/@angular/material/autocomplete/typings/autocomplete-trigger.d.ts(106,269): error TS2709: Cannot use namespace 'ViewportRuler' as a type.
node_modules/@angular/material/autocomplete/typings/autocomplete.d.ts(40,18): error TS2709: Cannot use namespace 'ActiveDescendantKeyManager' as a type.
node_modules/@angular/material/badge/typings/badge.d.ts(52,104): error TS2709: Cannot use namespace 'AriaDescriber' as a type.
node_modules/@angular/material/bottom-sheet/typings/bottom-sheet-config.d.ts(21,17): error TS2709: Cannot use namespace 'Direction' as a type.
node_modules/@angular/material/bottom-sheet/typings/bottom-sheet-container.d.ts(26,20): error TS2709: Cannot use namespace 'CdkPortalOutlet' as a type.
node_modules/@angular/material/bottom-sheet/typings/bottom-sheet-container.d.ts(39,113): error TS2709: Cannot use namespace 'FocusTrapFactory' as a type.
node_modules/@angular/material/bottom-sheet/typings/bottom-sheet-container.d.ts(39,151): error TS2709: Cannot use namespace 'BreakpointObserver' as a type.
node_modules/@angular/material/bottom-sheet/typings/bottom-sheet-container.d.ts(43,38): error TS2709: Cannot use namespace 'ComponentPortal' as a type.
node_modules/@angular/material/bottom-sheet/typings/bottom-sheet-container.d.ts(45,37): error TS2709: Cannot use namespace 'TemplatePortal' as a type.
node_modules/@angular/material/bottom-sheet/typings/bottom-sheet-ref.d.ts(32,74): error TS2709: Cannot use namespace 'OverlayRef' as a type.
node_modules/@angular/material/bottom-sheet/typings/bottom-sheet.d.ts(28,27): error TS2709: Cannot use namespace 'Overlay' as a type.
node_modules/@angular/material/bottom-sheet/typings/bottom-sheet.d.ts(29,42): error TS2709: Cannot use namespace 'ComponentType' as a type.
node_modules/@angular/material/button-toggle/typings/button-toggle.d.ts(174,144): error TS2709: Cannot use namespace 'FocusMonitor' as a type.
node_modules/@angular/material/button/typings/button.d.ts(35,16): error TS2709: Cannot use namespace 'Platform' as a type.
node_modules/@angular/material/button/typings/button.d.ts(35,41): error TS2709: Cannot use namespace 'FocusMonitor' as a type.
node_modules/@angular/material/button/typings/button.d.ts(50,27): error TS2709: Cannot use namespace 'Platform' as a type.
node_modules/@angular/material/button/typings/button.d.ts(50,51): error TS2709: Cannot use namespace 'FocusMonitor' as a type.
node_modules/@angular/material/checkbox/typings/checkbox.d.ts(99,108): error TS2709: Cannot use namespace 'FocusMonitor' as a type.
node_modules/@angular/material/chips/typings/chip-list.d.ts(86,18): error TS2709: Cannot use namespace 'FocusKeyManager' as a type.
node_modules/@angular/material/chips/typings/chip-list.d.ts(91,22): error TS2709: Cannot use namespace 'SelectionModel' as a type.
node_modules/@angular/material/chips/typings/chip-list.d.ts(176,100): error TS2709: Cannot use namespace 'Directionality' as a type.
node_modules/@angular/material/chips/typings/chip.d.ts(55,67): error TS2709: Cannot use namespace 'FocusableOption' as a type.
node_modules/@angular/material/chips/typings/chip.d.ts(113,69): error TS2709: Cannot use namespace 'Platform' as a type.
node_modules/@angular/material/core/typings/datetime/native-date-adapter.d.ts(26,50): error TS2709: Cannot use namespace 'Platform' as a type.
node_modules/@angular/material/core/typings/ripple/ripple-renderer.d.ts(77,104): error TS2709: Cannot use namespace 'Platform' as a type.
node_modules/@angular/material/core/typings/ripple/ripple.d.ts(74,81): error TS2709: Cannot use namespace 'Platform' as a type.
node_modules/@angular/material/datepicker/typings/calendar.d.ts(58,22): error TS2709: Cannot use namespace 'ComponentType' as a type.
node_modules/@angular/material/datepicker/typings/calendar.d.ts(60,28): error TS2709: Cannot use namespace 'Portal' as a type.
node_modules/@angular/material/datepicker/typings/datepicker.d.ts(19,75): error TS2709: Cannot use namespace 'ScrollStrategy' as a type.
node_modules/@angular/material/datepicker/typings/datepicker.d.ts(21,73): error TS2709: Cannot use namespace 'Overlay' as a type.
node_modules/@angular/material/datepicker/typings/datepicker.d.ts(21,89): error TS2709: Cannot use namespace 'ScrollStrategy' as a type.
node_modules/@angular/material/datepicker/typings/datepicker.d.ts(24,35): error TS2709: Cannot use namespace 'ScrollStrategy' as a type.
node_modules/@angular/material/datepicker/typings/datepicker.d.ts(62,30): error TS2709: Cannot use namespace 'ComponentType' as a type.
node_modules/@angular/material/datepicker/typings/datepicker.d.ts(112,16): error TS2709: Cannot use namespace 'OverlayRef' as a type.
node_modules/@angular/material/datepicker/typings/datepicker.d.ts(129,47): error TS2709: Cannot use namespace 'Overlay' as a type.
node_modules/@angular/material/datepicker/typings/datepicker.d.ts(129,167): error TS2709: Cannot use namespace 'Directionality' as a type.
node_modules/@angular/material/datepicker/typings/month-view.d.ts(65,123): error TS2709: Cannot use namespace 'Directionality' as a type.
node_modules/@angular/material/datepicker/typings/multi-year-view.d.ts(50,93): error TS2709: Cannot use namespace 'Directionality' as a type.
node_modules/@angular/material/datepicker/typings/year-view.d.ts(54,123): error TS2709: Cannot use namespace 'Directionality' as a type.
node_modules/@angular/material/dialog/typings/dialog-config.d.ts(64,17): error TS2709: Cannot use namespace 'Direction' as a type.
node_modules/@angular/material/dialog/typings/dialog-config.d.ts(77,22): error TS2709: Cannot use namespace 'ScrollStrategy' as a type.
node_modules/@angular/material/dialog/typings/dialog-container.d.ts(32,20): error TS2709: Cannot use namespace 'CdkPortalOutlet' as a type.
node_modules/@angular/material/dialog/typings/dialog-container.d.ts(45,61): error TS2709: Cannot use namespace 'FocusTrapFactory' as a type.
node_modules/@angular/material/dialog/typings/dialog-container.d.ts(52,38): error TS2709: Cannot use namespace 'ComponentPortal' as a type.
node_modules/@angular/material/dialog/typings/dialog-container.d.ts(57,37): error TS2709: Cannot use namespace 'TemplatePortal' as a type.
node_modules/@angular/material/dialog/typings/dialog-ref.d.ts(32,30): error TS2709: Cannot use namespace 'OverlayRef' as a type.
node_modules/@angular/material/dialog/typings/dialog.d.ts(20,71): error TS2709: Cannot use namespace 'ScrollStrategy' as a type.
node_modules/@angular/material/dialog/typings/dialog.d.ts(22,69): error TS2709: Cannot use namespace 'Overlay' as a type.
node_modules/@angular/material/dialog/typings/dialog.d.ts(22,85): error TS2709: Cannot use namespace 'ScrollStrategy' as a type.
node_modules/@angular/material/dialog/typings/dialog.d.ts(24,78): error TS2709: Cannot use namespace 'Overlay' as a type.
node_modules/@angular/material/dialog/typings/dialog.d.ts(24,94): error TS2709: Cannot use namespace 'ScrollStrategy' as a type.
node_modules/@angular/material/dialog/typings/dialog.d.ts(27,35): error TS2709: Cannot use namespace 'ScrollStrategy' as a type.
node_modules/@angular/material/dialog/typings/dialog.d.ts(62,27): error TS2709: Cannot use namespace 'Overlay' as a type.
node_modules/@angular/material/dialog/typings/dialog.d.ts(62,178): error TS2709: Cannot use namespace 'OverlayContainer' as a type.
node_modules/@angular/material/dialog/typings/dialog.d.ts(70,55): error TS2709: Cannot use namespace 'ComponentType' as a type.
node_modules/@angular/material/expansion/typings/accordion-base.d.ts(16,43): error TS2709: Cannot use namespace 'CdkAccordion' as a type.
node_modules/@angular/material/expansion/typings/expansion-panel-header.d.ts(16,68): error TS2709: Cannot use namespace 'FocusableOption' as a type.
node_modules/@angular/material/expansion/typings/expansion-panel-header.d.ts(22,80): error TS2709: Cannot use namespace 'FocusMonitor' as a type.
node_modules/@angular/material/expansion/typings/expansion-panel-header.d.ts(49,20): error TS2709: Cannot use namespace 'FocusOrigin' as a type.
node_modules/@angular/material/expansion/typings/expansion-panel.d.ts(61,14): error TS2709: Cannot use namespace 'TemplatePortal' as a type.
node_modules/@angular/material/expansion/typings/expansion-panel.d.ts(66,113): error TS2709: Cannot use namespace 'UniqueSelectionDispatcher' as a type.
node_modules/@angular/material/form-field/typings/form-field.d.ts(110,115): error TS2709: Cannot use namespace 'Directionality' as a type.
node_modules/@angular/material/form-field/typings/form-field.d.ts(110,182): error TS2709: Cannot use namespace 'Platform' as a type.
node_modules/@angular/material/grid-list/typings/grid-list.d.ts(32,58): error TS2709: Cannot use namespace 'Directionality' as a type.
node_modules/@angular/material/input/typings/input.d.ts(30,26): error TS2709: Cannot use namespace 'Platform' as a type.
node_modules/@angular/material/input/typings/input.d.ts(100,113): error TS2709: Cannot use namespace 'Platform' as a type.
node_modules/@angular/material/input/typings/input.d.ts(102,175): error TS2709: Cannot use namespace 'AutofillMonitor' as a type.
node_modules/@angular/material/list/typings/selection-list.d.ts(41,116): error TS2709: Cannot use namespace 'FocusableOption' as a type.
node_modules/@angular/material/list/typings/selection-list.d.ts(97,85): error TS2709: Cannot use namespace 'FocusableOption' as a type.
node_modules/@angular/material/list/typings/selection-list.d.ts(100,18): error TS2709: Cannot use namespace 'FocusKeyManager' as a type.
node_modules/@angular/material/list/typings/selection-list.d.ts(117,22): error TS2709: Cannot use namespace 'SelectionModel' as a type.
node_modules/@angular/material/menu/typings/menu-directive.d.ts(61,16): error TS2709: Cannot use namespace 'Direction' as a type.
node_modules/@angular/material/menu/typings/menu-directive.d.ts(123,29): error TS2709: Cannot use namespace 'FocusOrigin' as a type.
node_modules/@angular/material/menu/typings/menu-item.d.ts(21,75): error TS2709: Cannot use namespace 'FocusableOption' as a type.
node_modules/@angular/material/menu/typings/menu-item.d.ts(34,87): error TS2709: Cannot use namespace 'FocusMonitor' as a type.
node_modules/@angular/material/menu/typings/menu-item.d.ts(36,20): error TS2709: Cannot use namespace 'FocusOrigin' as a type.
node_modules/@angular/material/menu/typings/menu-panel.d.ts(29,17): error TS2709: Cannot use namespace 'Direction' as a type.
node_modules/@angular/material/menu/typings/menu-panel.d.ts(30,31):
Я попробовал все, чтобы это заработало.Я пробовал версии от 6 до самых последних, различных рекомендуемых комбинаций версий Angular / Typescript.Но я не могу найти причину почему.Я не поместил здесь полный STDOUT ошибки, все ошибки одинаковы.
Мой package.json настроен следующим образом:
"dependencies": {
"@angular/animations": "7.2.7",
"@angular/common": "7.2.7",
"@angular/compiler": "7.2.7",
"@angular/core": "7.2.7",
"@angular/forms": "7.2.7",
"@angular/material": "7.3.3",
"@angular/platform-browser": "7.2.7",
"@angular/platform-browser-dynamic": "7.2.7",
"@angular/platform-server": "7.2.7",
"@angular/router": "7.2.7",
"angular-moment-timezone": "1.7.1",
"core-js": "2.6.5",
"http-server": "0.11.1",
"ie-shim": "0.1.0",
"ng2-date-picker": "2.11.0",
"ngx-cookie-service": "2.1.0",
"reflect-metadata": "0.1.12",
"rxjs": "6.4.0",
"rxjs-compat": "6.4.0",
"zone.js": "0.8.29"
},
"devDependencies": {
"@angular-devkit/build-optimizer": "0.13.4",
"@angular/cli": "7.3.4",
"@angular/compiler-cli": "7.2.7",
"@angular/language-service": "7.2.7",
"@compodoc/compodoc": "1.1.8",
"@ngtools/webpack": "7.3.4",
"@types/hammerjs": "2.0.36",
"@types/jasmine": "3.3.9",
"@types/jasminewd2": "2.0.6",
"@types/lodash": "4.14.121",
"@types/node": "11.9.6",
"@types/source-map": "0.5.7",
"@types/uglify-js": "3.0.4",
"@types/webpack": "4.4.25",
"@types/angular-material": "1.1.66",
"add-asset-html-webpack-plugin": "3.1.3",
"angular2-template-loader": "0.6.2",
"assets-webpack-plugin": "3.9.10",
"awesome-typescript-loader": "5.2.1",
"codelyzer": "4.5.0",
"copy-webpack-plugin": "5.0.0",
"cross-env": "5.2.0",
"css-loader": "2.1.0",
"exports-loader": "0.7.0",
"expose-loader": "0.7.5",
"file-loader": "3.0.1",
"find-root": "1.1.0",
"gh-pages": "2.0.1",
"html-webpack-plugin": "3.2.0",
"imports-loader": "0.8.0",
"istanbul-instrumenter-loader": "3.0.1",
"jasmine-core": "3.3.0",
"karma": "4.0.1",
"karma-chrome-launcher": "2.2.0",
"karma-coverage": "1.1.2",
"karma-jasmine": "2.0.1",
"karma-mocha-reporter": "2.2.5",
"karma-remap-coverage": "0.1.5",
"karma-sourcemap-loader": "0.3.7",
"karma-webpack": "3.0.5",
"mini-css-extract-plugin": "0.5.0",
"node-sass": "4.11.0",
"npm-run-all": "4.1.5",
"optimize-js-plugin": "0.0.4",
"parse5": "5.1.0",
"protractor": "5.4.2",
"raw-loader": "1.0.0",
"rimraf": "2.6.3",
"rxjs-tslint": "0.1.7",
"sass-loader": "7.1.0",
"script-ext-html-webpack-plugin": "2.1.3",
"source-map-loader": "0.2.4",
"string-replace-loader": "2.1.1",
"style-loader": "0.23.1",
"to-string-loader": "1.1.5",
"ts-node": "8.0.2",
"tslib": "1.9.3",
"tslint": "5.13.1",
"tslint-loader": "3.5.4",
"typedoc": "0.14.2",
"typescript": "3.2.4",
"uglifyjs-webpack-plugin": "2.1.2",
"url-loader": "1.1.2",
"webpack": "4.29.6",
"webpack-cli": "3.2.3",
"webpack-dev-middleware": "3.6.0",
"webpack-dev-server": "3.2.1",
"webpack-inline-manifest-plugin": "4.0.1",
"webpack-merge": "4.2.1",
"handlebars": "4.1.0"
}
Я использую стартер: https://github.com/qdouble/angular-webpack-starter
И пытаюсь увеличить версию угловой с 6 до 7. Спасибо