没有导出的成员'MD_XXX_DIRECTIVES

时间:2016-09-21 15:22:01

标签: angular typescript angular-material

我是Angular2的新手。所以我正在使用角度材料进行项目。但是,我有那些:

  

“没有导出的成员MD_XXX_DIRECTIVES”错误(例如:MD_SIDENAV_DIRECTIVES,MD_LIST_DIRECTIVES)。

这些是 package.json 依赖项:

"dependencies": {
    "@angular/common": "2.0.0-rc.4",
    "@angular/compiler": "2.0.0-rc.4",
    "@angular/core": "2.0.0-rc.4",
    "@angular/forms": "0.2.0",
    "@angular/http": "2.0.0-rc.4",
    "@angular/platform-browser": "2.0.0-rc.4",
    "@angular/platform-browser-dynamic": "2.0.0-rc.4",
    "@angular/router": "3.0.0-beta.2",
    "@angular/router-deprecated": "2.0.0-rc.2",
    "@angular/upgrade": "2.0.0-rc.4",
    "@angular2-material/button": "^2.0.0-alpha.5-2",
    "@angular2-material/card": "^2.0.0-alpha.5-2",
    "@angular2-material/checkbox": "^2.0.0-alpha.5-2",
    "@angular2-material/core": "^2.0.0-alpha.8-2",
    "@angular2-material/grid-list": "^2.0.0-alpha.6",
    "@angular2-material/icon": "^2.0.0-alpha.5-2",
    "@angular2-material/input": "^2.0.0-alpha.5-2",
    "@angular2-material/list": "^2.0.0-alpha.5-2",
    "@angular2-material/progress-circle": "^2.0.0-alpha.6",
    "@angular2-material/radio": "^2.0.0-alpha.5-2",
    "@angular2-material/sidenav": "^2.0.0-alpha.5-2",
    "@angular2-material/toolbar": "^2.0.0-alpha.5-2"}

感谢您的帮助。

1 个答案:

答案 0 :(得分:0)

使用npm包版本中的^标识符,让npm安装最新版本。最新版本不再导出指令,而是导出模块。删除它,然后删除软件包并安装特别需要的版本(2.0.0-alpha.5-2)允许再次使用该指令。