模块没有出口会员

时间:2018-02-07 12:28:14

标签: angular typescript angular-material

错误

app.module.ts

 var arr = arrayOf("neel", "nilu", "nilesh", "nil")
for (item in arr.indices) {

        // printing array elements having even index only
        if (item%2 == 0)
            println(language[item])
    }
  

错误:模块“d:/ projectname / nodule_modules / @ angular / cdk / cdk没有熟练的成员CdkTableModule。

当我尝试导入

import {CdkTableModule} from '@angular/cdk';
  

错误:模块“d:/ projectname / nodule_modules / @ angular / matrial / material没有熟练的成员MatCoreModule。

ng version

  import {MatCoreModule} from '@angular/material';

的package.json

            Angular CLI: 1.6.7
            Node: 8.3.0
            OS: win32 x64
            Angular: 4.4.6
            ... animations, common, compiler, compiler-cli, core, forms
            ... http, language-service, platform-browser
            ... platform-browser-dynamic, router, tsc-wrapped

            @angular/animation: 4.0.0-beta.8
            @angular/cdk: 2.0.0-beta.12
            @angular/cli: 1.6.7
            @angular/material: 2.0.0-beta.12
            @angular-devkit/build-optimizer: 0.0.42
            @angular-devkit/core: 0.0.29
            @angular-devkit/schematics: 0.0.52
            @ngtools/json-schema: 1.1.0
            @ngtools/webpack: 1.9.7
            @schematics/angular: 0.1.17
            typescript: 2.7.1
            webpack: 3.10.0
  • 任何人都可以建议我缺少新的2.0.0-beta.12。

  • 之前我尝试导入

                                            {
                                    "name": "angular2-bug-testing",
                                    "version": "0.0.0",
                                    "license": "MIT",
                                    "scripts": {
                                    "ng": "ng",
                                    "start": "ng serve",
                                    "build": "ng build",
                                    "test": "ng test",
                                    "lint": "ng lint",
                                    "e2e": "ng e2e"
                                    },
                                    "private": true,
                                    "dependencies": {
                                    "@angular/animation": "^4.0.0-beta.8",
                                    "@angular/animations": "^4.4.6",
                                    "@angular/cdk": "^2.0.0-beta.12",
                                    "@angular/common": "^4.4.6",
                                    "@angular/compiler": "^4.4.6",
                                    "@angular/core": "^4.4.6",
                                    "@angular/forms": "^4.4.6",
                                    "@angular/http": "^4.4.6",
                                    "@angular/material": "^2.0.0-beta.12",
                                    "@angular/platform-browser": "^4.4.6",
                                    "@angular/platform-browser-dynamic": "^4.4.6",
                                    "@angular/router": "^4.4.6",
                                    "angular-datatables": "^4.4.1",
                                    "angular-in-memory-web-api": "^0.3.2",
                                    "core-js": "^2.5.3",
                                    "datatables.net": "^1.10.16",
                                    "datatables.net-buttons-dt": "^1.5.1",
                                    "datatables.net-dt": "^1.10.16",
                                    "hammerjs": "^2.0.8",
                                    "jquery": "^3.3.1",
                                    "json-server": "^0.12.1",
                                    "rxjs": "^5.5.6",
                                    "zone.js": "^0.8.20"
                                    },
                                    "devDependencies": {
                                    "@angular/cli": "^1.6.7",
                                    "@angular/compiler-cli": "^4.4.6",
                                    "@angular/language-service": "^4.4.6",
                                    "@types/datatables.net": "^1.10.8",
                                    "@types/jasmine": "^2.8.6",
                                    "@types/jasminewd2": "^2.0.3",
                                    "@types/jquery": "^3.3.0",
                                    "@types/node": "^6.0.96",
                                    "codelyzer": "^3.2.2",
                                    "jasmine-core": "^2.9.1",
                                    "jasmine-spec-reporter": "^4.2.1",
                                    "karma": "^1.7.1",
                                    "karma-chrome-launcher": "^2.2.0",
                                    "karma-cli": "^1.0.1",
                                    "karma-coverage-istanbul-reporter": "^1.4.1",
                                    "karma-jasmine": "^1.1.1",
                                    "karma-jasmine-html-reporter": "^0.2.2",
                                    "protractor": "^5.3.0",
                                    "ts-node": "^3.3.0",
                                    "tslint": "^5.9.1",
                                    "typescript": "^2.7.1"
                                    }
                                    }
    

1 个答案:

答案 0 :(得分:1)

首次导入导入路径错误。应该是这样的:

import {CdkTableModule} from '@angular/cdk/table';

第二个被删除:

  

MdCoreModule已被删除。它的大部分功能都是   在过去的几个版本中移动到@ angular / cdk。

gitHub