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).
** angular-cli.json **ファイルを投稿できますか? ** Typescript **のどのバージョンを使用していますか? –
コンポーネントコードはどうですか?問題を引き起こしている可能性があります。 – Edric
バージョン5の最新の資料を入手するなど、壊れやすい変更をインストールする可能性があるため、NPM Iを実行すると問題は注意が必要ですが、バージョン4のD –