2017-11-09 6 views
1

npm install @ angular/materialとnpm install @ angular/cdkをインストールしてプロジェクトの角度素材に追加しました。 .d.tsファイルのエラーが発生しています。角度4:Angular素材を追加するとd.tsファイルでCliコンパイラの問題が発生する

私はtsconfig.jsonファイル

{ 
    "compileOnSave": false, 
    "compilerOptions": { 
    "outDir": "./dist/out-tsc", 
    "baseUrl": "src", 
    "sourceMap": true, 
    "declaration": false, 
    "moduleResolution": "node", 
    "emitDecoratorMetadata": true, 
    "experimentalDecorators": true, 
    "target": "es5", 
    "types": [ "node", "mocha", "chai" ], 
    "typeRoots": [ 
     "node_modules/@types" 
    ], 
    "lib": [ 
     "es2016", 
     "dom" 
    ] 
    }, 
    "exclude": [ 
    "node_modules", 
    "wwwroot", 
    "typings/main", 
    "typings/main.d.ts" 
    ] 
} 

tsconfig.app.json

{ 
    "extends": "../tsconfig.json", 
    "compilerOptions": { 
    "outDir": "../out-tsc/app", 
    "module": "es2015", 
    "baseUrl": "", 
    "types": [] 
    }, 
    "exclude": [ 
    "test.ts", 
    "**/*.spec.ts", 
    "typings" 
    ] 
} 

エラーチェックしました:あなたは「私をNPMないとき

RROR in /node_modules/@angular/material/dialog/typings/dialog-config.d.ts (22,40): ',' expected. 

    ERROR in /node_modules/@angular/material/dialog/typings/dialog-config.d.ts (22,42): Type parameter name cannot be 'any' 

    ERROR in /node_modules/@angular/material/dialog/typings/dialog-container.d.ts (36,14): Generic type 'MatDialogConfig<D, any>' requires 2 type argument(s). 

    ERROR in /node_modules/@angular/material/dialog/typings/dialog.d.ts (49,15): ',' expected. 

    ERROR in /node_modules/@angular/material/dialog/typings/dialog.d.ts (49,17): Type parameter name cannot be 'any' 

    ERROR in /node_modules/@angular/material/dialog/typings/dialog.d.ts (49,90): Generic type 'MatDialogConfig<D, any>' requires 2 type argument(s). 
+0

** angular-cli.json **ファイルを投稿できますか? ** Typescript **のどのバージョンを使用していますか? –

+0

コンポーネントコードはどうですか?問題を引き起こしている可能性があります。 – Edric

+0

バージョン5の最新の資料を入手するなど、壊れやすい変更をインストールする可能性があるため、NPM Iを実行すると問題は注意が必要ですが、バージョン4のD –

答えて

1

は注意してください@あなたは最新のものをインストールし、最新のものには大きな変化があります。あなたのIDEがあなたに前もって話すことができず、続行したいかどうか尋ねることができないことは残念です。角度/材料@

は、最新のtypescriptですを求めている、と2.4で、最新のtypescriptですが、私は同じ@角度/ CDKのために行く5.

アンギュラバージョンに取り組んでいると思います。

最終的には、安定版でありベータ版ではありません。

関連する問題