2017-05-15 16 views
4

Angular4で「角度材」を実装しようとしています。私は、角度材料の公式サイトからのすべての設定を行って[angular.material.io] [1]角度4と材質

[1]:https://material.angular.io/guide/getting-startedが、NPM開始してプロジェクトを実行しようとすると、次のエラー取得:

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.

を誰か、上記の修正を手伝ってください。

+0

問題の内容を適切に並べ替えてください。 –

+0

パッケージが破損しています。パッケージはいつでも永続的に破棄されます。すぐにそれらを使用することはできません。 – Gedweb

答えて

3

package.jsonの依存関係とdevDependenciesファイルをダブルチェックして、あなたのtypescriptのインストールを見つけてください。それが2.2.0以上であることを確認してください。

"typescript": "~2.2.0" 

変更を行った場合、あなたはそれが世界的にをインストールして実行し、あなたのpackage.jsonファイルにはtypescriptですラインは、ありません持っている場合は、

$ npm update -D 

を実行するようにしてください

$ npm install -g [email protected] 
0

上記の回答に加えて、私はpackage.jsonファイルのスクリーンショットを追加しました:

package.json

ステップ1:typescriptですバージョンが2.2.0より小さい場合は、最新のvesrionように変更し、以下に示すよう

は、あなたのpackage.jsonに移動し、依存関係とdevDependiesをチェック画像に示されています。

ステップ2:あなたの端末で実行NPM更新-D

ステップ3:以下のコマンドを実行し、typescriptですを更新しグローバルに:-g typescriptですが、@のバージョン番号を

NPMをインストール

関連する問題