2017-07-06 106 views
1

我试着材料的设计添加到我的项目,但是当我运行npm start我得到的错误。我试着做下面的“入门” https://material.angular.io/guide/getting-started不能材料的设计添加到角项目

我做了所有的步骤,这不起作用。你知道一些关于角度+材料设计的教程吗?

node_modules/@angular/material/typings/button-toggle/button-toggle.d.ts(31,22): error TS2420: Class 'MdButtonToggleGroup' incorrectly implements interface 'CanDisable'. 
    Property 'disabled' is missing in type 'MdButtonToggleGroup'. 
node_modules/@angular/material/typings/button-toggle/button-toggle.d.ts(31,50): error TS2507: Type '(new (...args: any[]) => CanDisable) & typeof MdButtonToggleGroupBase' is not a constructor function type. 
node_modules/@angular/material/typings/button-toggle/button-toggle.d.ts(90,22): error TS2420: Class 'MdButtonToggleGroupMultiple' incorrectly implements interface 'CanDisable'. 
    Property 'disabled' is missing in type 'MdButtonToggleGroupMultiple'. 
node_modules/@angular/material/typings/button-toggle/button-toggle.d.ts(90,58): error TS2507: Type '(new (...args: any[]) => CanDisable) & typeof MdButtonToggleGroupBase' is not a constructor function type. 
node_modules/@angular/material/typings/button/button.d.ts(54,22): error TS2420: Class 'MdButton' incorrectly implements interface 'CanColor'. 
    Property 'color' is missing in type 'MdButton'. 
node_modules/@angular/material/typings/button/button.d.ts(54,22): error TS2420: Class 'MdButton' incorrectly implements interface 'CanDisable'. 
    Property 'disabled' is missing in type 'MdButton'. 
node_modules/@angular/material/typings/button/button.d.ts(54,39): error TS2507: Type '(new (...args: any[]) => CanColor) & (new (...args: any[]) => CanDisable) & typeof MdButtonBase' is not a constructor function type. 
node_modules/@angular/material/typings/checkbox/checkbox.d.ts(54,22): error TS2420: Class 'MdCheckbox' incorrectly implements interface 'CanColor'. 
    Property 'color' is missing in type 'MdCheckbox'. 
node_modules/@angular/material/typings/checkbox/checkbox.d.ts(54,22): error TS2420: Class 'MdCheckbox' incorrectly implements interface 'CanDisable'. 
    Property 'disabled' is missing in type 'MdCheckbox'. 
node_modules/@angular/material/typings/checkbox/checkbox.d.ts(54,41): error TS2507: Type '(new (...args: any[]) => CanColor) & (new (...args: any[]) => CanDisable) & typeof MdCheckboxBase' is not a constructor function type. 
node_modules/@angular/material/typings/chips/chip.d.ts(30,22): error TS2420: Class 'MdChip' incorrectly implements interface 'CanColor'. 
    Property 'color' is missing in type 'MdChip'. 
node_modules/@angular/material/typings/chips/chip.d.ts(30,22): error TS2420: Class 'MdChip' incorrectly implements interface 'CanDisable'. 
    Property 'disabled' is missing in type 'MdChip'. 
node_modules/@angular/material/typings/chips/chip.d.ts(30,37): error TS2507: Type '(new (...args: any[]) => CanColor) & (new (...args: any[]) => CanDisable) & typeof MdChipBase' is not a constructor function type. 
node_modules/@angular/material/typings/core/option/optgroup.d.ts(8,22): error TS2420: Class 'MdOptgroup' incorrectly implements interface 'CanDisable'. 
    Property 'disabled' is missing in type 'MdOptgroup'. 
node_modules/@angular/material/typings/core/option/optgroup.d.ts(8,41): error TS2507: Type '(new (...args: any[]) => CanDisable) & typeof MdOptgroupBase' is not a constructor function type. 
node_modules/@angular/material/typings/core/selection/pseudo-checkbox/pseudo-checkbox.d.ts(28,22): error TS2420: Class 'MdPseudoCheckbox' incorrectly implements interface 'CanColor'. 
    Property 'color' is missing in type 'MdPseudoCheckbox'. 
node_modules/@angular/material/typings/core/selection/pseudo-checkbox/pseudo-checkbox.d.ts(28,47): error TS2507: Type '(new (...args: any[]) => CanColor) & typeof MdPseudoCheckboxBase' is not a constructor function type. 
node_modules/@angular/material/typings/icon/icon.d.ts(50,22): error TS2420: Class 'MdIcon' incorrectly implements interface 'CanColor'. 
    Property 'color' is missing in type 'MdIcon'. 
node_modules/@angular/material/typings/icon/icon.d.ts(50,37): error TS2507: Type '(new (...args: any[]) => CanColor) & typeof MdIconBase' is not a constructor function type. 
node_modules/@angular/material/typings/menu/menu-item.d.ts(18,22): error TS2420: Class 'MdMenuItem' incorrectly implements interface 'CanDisable'. 
    Property 'disabled' is missing in type 'MdMenuItem'. 
node_modules/@angular/material/typings/menu/menu-item.d.ts(18,41): error TS2507: Type '(new (...args: any[]) => CanDisable) & typeof MdMenuItemBase' is not a constructor function type. 
node_modules/@angular/material/typings/progress-spinner/progress-spinner.d.ts(28,22): error TS2420: Class 'MdProgressSpinner' incorrectly implements interface 'CanColor'. 
    Property 'color' is missing in type 'MdProgressSpinner'. 
node_modules/@angular/material/typings/progress-spinner/progress-spinner.d.ts(28,48): error TS2507: Type '(new (...args: any[]) => CanColor) & typeof MdProgressSpinnerBase' is not a constructor function type. 
node_modules/@angular/material/typings/radio/radio.d.ts(32,43): error TS2507: Type '(new (...args: any[]) => CanDisable) & typeof MdRadioGroupBase' is not a constructor function type. 
node_modules/@angular/material/typings/radio/radio.d.ts(131,22): error TS2420: Class 'MdRadioButton' incorrectly implements interface 'CanColor'. 
    Property 'color' is missing in type 'MdRadioButton'. 
node_modules/@angular/material/typings/radio/radio.d.ts(131,44): error TS2507: Type '(new (...args: any[]) => CanColor) & typeof MdRadioButtonBase' is not a constructor function type. 
node_modules/@angular/material/typings/select/select.d.ts(77,22): error TS2420: Class 'MdSelect' incorrectly implements interface 'CanColor'. 
    Property 'color' is missing in type 'MdSelect'. 
node_modules/@angular/material/typings/select/select.d.ts(77,22): error TS2420: Class 'MdSelect' incorrectly implements interface 'CanDisable'. 
    Property 'disabled' is missing in type 'MdSelect'. 
node_modules/@angular/material/typings/select/select.d.ts(77,39): error TS2507: Type '(new (...args: any[]) => CanColor) & (new (...args: any[]) => CanDisable) & typeof MdSelectBase' is not a constructor function type. 
node_modules/@angular/material/typings/slide-toggle/slide-toggle.d.ts(25,22): error TS2420: Class 'MdSlideToggle' incorrectly implements interface 'CanColor'. 
    Property 'color' is missing in type 'MdSlideToggle'. 
node_modules/@angular/material/typings/slide-toggle/slide-toggle.d.ts(25,22): error TS2420: Class 'MdSlideToggle' incorrectly implements interface 'CanDisable'. 
    Property 'disabled' is missing in type 'MdSlideToggle'. 
node_modules/@angular/material/typings/slide-toggle/slide-toggle.d.ts(25,44): error TS2507: Type '(new (...args: any[]) => CanColor) & (new (...args: any[]) => CanDisable) & typeof MdSlideToggleB...' is not a constructor function type. 
node_modules/@angular/material/typings/slider/slider.d.ts(33,22): error TS2420: Class 'MdSlider' incorrectly implements interface 'CanDisable'. 
    Property 'disabled' is missing in type 'MdSlider'. 
node_modules/@angular/material/typings/slider/slider.d.ts(33,39): error TS2507: Type '(new (...args: any[]) => CanDisable) & typeof MdSliderBase' is not a constructor function type. 
node_modules/@angular/material/typings/tabs/tab-label-wrapper.d.ts(17,22): error TS2420: Class 'MdTabLabelWrapper' incorrectly implements interface 'CanDisable'. 
    Property 'disabled' is missing in type 'MdTabLabelWrapper'. 
node_modules/@angular/material/typings/tabs/tab-label-wrapper.d.ts(17,48): error TS2507: Type '(new (...args: any[]) => CanDisable) & typeof MdTabLabelWrapperBase' is not a constructor function type. 
node_modules/@angular/material/typings/tabs/tab.d.ts(15,22): error TS2420: Class 'MdTab' incorrectly implements interface 'CanDisable'. 
    Property 'disabled' is missing in type 'MdTab'. 
node_modules/@angular/material/typings/tabs/tab.d.ts(15,36): error TS2507: Type '(new (...args: any[]) => CanDisable) & typeof MdTabBase' is not a constructor function type. 
node_modules/@angular/material/typings/toolbar/toolbar.d.ts(18,22): error TS2420: Class 'MdToolbar' incorrectly implements interface 'CanColor'. 
    Property 'color' is missing in type 'MdToolbar'. 
node_modules/@angular/material/typings/toolbar/toolbar.d.ts(18,40): error TS2507: Type '(new (...args: any[]) => CanColor) & typeof MdToolbarBase' is not a constructor function type. 
+0

找到答案有什么好运?现在处理这个权利。 –

+0

发现在这个职位的答案:[https://stackoverflow.com/questions/43973533/angular-4-with-material](https://stackoverflow.com/questions/43973533/angular-4-with-material) –

回答

1

请检查您的打字稿版本在您的package.json。如果打字稿版本小于2.2.0,则将其更改为最新版本。 并在您的终端中运行npm update -D