4

I am trying to implement "Angular-Material" with Angular4. I made all setup from official site of angular material [angular.material.io][1]

[1]: https://material.angular.io/guide/getting-started but when trying to run project by npm start, getting following error:

node_modules/@angular/material/typings/button/button.d.ts(40,22): error TS2420: Class 'MdButton' incorrectly implements interface 'CanDisable'. Property 'disabled' is private in type 'MdButton' but not in type 'CanDisable'. node_modules/@angular/material/typings/button/button.d.ts(40,39): error TS2507: Type '(new (...args: any[]) => CanDisable) & typeof MdButtonBase' is not a constructor function type. node_modules/@angular/material/typings/checkbox/checkbox.d.ts(43,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(43,41): error TS2507: Type '(new (...args: any[]) => CanDisable) & typeof MdCheckboxBase' is not a constructor function type. node_modules/@angular/material/typings/radio/radio.d.ts(24,22): error TS2420: Class 'MdRadioGroup' incorrectly implements interface 'CanDisable'. Property 'disabled' is missing in type 'MdRadioGroup'. node_modules/@angular/material/typings/radio/radio.d.ts(24,43): error TS2507: Type '(new (...args: any[]) => CanDisable) & typeof MdRadioGroupBase' is not a constructor function type. node_modules/@angular/material/typings/slide-toggle/slide-toggle.d.ts(14,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(14,44): error TS2507: Type '(new (...args: any[]) => CanDisable) & typeof MdSlideToggleBase' is not a constructor function type. node_modules/@angular/material/typings/slider/slider.d.ts(26,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(26,39): error TS2507: Type '(new (...args: any[]) => CanDisable) & typeof MdSliderBase' is not a constructor function type.

Somebody, please help me to fix above.

2
  • Please rearrange the content in the question properly. Commented May 15, 2017 at 7:20
  • A package is broken, its persistent state at any time. Is not possible to use them soon time. Commented May 21, 2017 at 20:59

2 Answers 2

3

Double check your package.json dependencies and devDependencies file and find your typescript install. Make certain it is 2.2.0 or greater.

"typescript": "~2.2.0"

If you make a change, be sure to then run

$ npm update -D

If you have it installed globally and there is no typescript line in your package.json file, run

$ npm install -g [email protected]
Sign up to request clarification or add additional context in comments.

Comments

0

In addition to above answer, i have added the screenshot of package.json file :

Go to your package.json and check dependencies and devDependies as shown below: package.json

Step 1: If the typescript version is less than 2.2.0 , change it to the latest vesrion as shown in the image.

Step2: Run npm update -D in your terminal

Step3: To globally update the typescript , execute following command:

npm install -g typescript@version-number

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.