某些内容: 角度版本:5.2.0
""@angular/common": "^5.2.0",
"@angular/compiler": "^5.2.0", "rxjs": "^5.5.6","
我正在尝试安装Ng Ant Design。我了解最新版本可能基于Angular 7构建,因此我采用了以前的版本。
"ng-zorro-antd": "1.8.1"
我在Angular CDK上遇到错误,所以我故意安装了
"@angular/cdk": "^5.2.0",
"@angular/material": "^5.2.0"
但是我仍然遇到这些错误
`ERROR in node_modules/ng-zorro-antd/node_modules/@angular/cdk/observers/typings/observe-content.d.ts(26,22): error TS2315: Type 'ElementRef' is not generic.
node_modules/ng-zorro-antd/node_modules/@angular/cdk/observers/typings/observe-content.d.ts(60,65): error TS2315: Type 'ElementRef' is not generic.
node_modules/ng-zorro-antd/node_modules/@angular/cdk/overlay/typings/position/connected-position-strategy.d.ts(33,106): error TS2315: Type 'ElementRef' is not generic.
node_modules/ng-zorro-antd/node_modules/@angular/cdk/a11y/typings/focus-monitor/focus-monitor.d.ts(117,30): error TS2315: Type 'ElementRef' is not generic.
node_modules/ng-zorro-antd/node_modules/@angular/cdk/a11y/typings/focus-trap/focus-trap.d.ts(118,30): error TS2315: Type 'ElementRef' is not generic.
node_modules/ng-zorro-antd/drawer/nz-drawer-ref.d.ts(1,28): error TS2307: Cannot find module 'rxjs/index'.
package-lock.json文件显示了此内容,因此我也尝试安装了“ @ angular / cdk”:“ 6.4.7”,但是得到相同的错误。
"ng-zorro-antd": {
"version": "1.8.1",
"resolved": "https://registry.npmjs.org/ng-zorro-antd/-/ng-zorro-antd-1.8.1.tgz",
"integrity": "sha512-XNEwzt535/rILb/tEEwYBd2Ex4B4BwH7dzlbJAcpZZnN2tbIJYGNUiwbHo/o6t41Fv0qAgF/zmIlI0wQH+U7yA==",
"requires": {
"@angular/cdk": "^6.0.0",
"@ant-design/icons-angular": "^1.0.1",
"date-fns": "^1.29.0",
"tslib": "^1.9.0"
},
"dependencies": {
"@angular/cdk": {
"version": "6.4.7",
"resolved": "https://registry.npmjs.org/@angular/cdk/-/cdk-6.4.7.tgz",
"integrity": "sha512-18x0U66fLD5kGQWZ9n3nb75xQouXlWs7kUDaTd8HTrHpT1s2QIAqlLd1KxfrYiVhsEC2jPQaoiae7VnBlcvkBg==",
"requires": {
"tslib": "^1.7.1"
}
}
}
}
答案 0 :(得分:0)
您有两个选择:
有关其依赖性历史记录https://github.com/NG-ZORRO/ng-zorro-antd/blob/0.7.1/package.json
,请参阅package.json。