2017-11-09 9 views
1

npm install @ angle/material 및 npm install/angle/cdk을 설치하여 프로젝트 각도 재료를 추가했습니다. 이제는 앱을 컴파일 할 때 .d.ts 파일 오류가 발생했습니다.각도 4 : 각도 재질 추가시 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" 
    ] 
} 

오류 확인했습니다 당신이 할 때

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

문제는 NPM I을 할 때주의해야합니다. 버전 5에 대한 최신 자료를 얻는 것과 같은 급격한 변경 사항을 설치할 수는 있지만 버전 4가 있습니다. D –

답변

1

것은주의 '내가 NPM을 @ 각도/재질 '을 최신으로 설치하고 최신에는 큰 변화가 있습니다. IDE가 선행 정보를 알려주지 않고 계속 진행할 것인지 묻는 것은 부끄러운 일입니다. 각도/재료 @

최신 타이프 라이터를 요청하고, 2.4 최신 타이프 라이터가 난 단지 같은이 @ 각도/CDK 간다 5.

각도 버전에 노력하고 있습니다 생각합니다.

가장 좋은 점은 마침내 안정적인 버전이며 베타가 아니라는 것입니다.