1

我在我的角项目中使用角材料2。

这是 package.json 中依赖项下的条目

"@angular/material": "^2.0.0-beta.1",

我尝试了以下命令

npm update @angular/material

但这以一些错误结束

+-- @angular/material@2.0.0-beta.2
`-- UNMET PEER DEPENDENCY rxjs@5.0.1

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@^1.0.0 (node_modules\chokidar\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.1.1: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"
x64"})
npm WARN ng2-md-datatable@1.0.14 requires a peer of rxjs@~5.0.2 but none was installed.
npm WARN ng2-md-datatable@1.0.15 requires a peer of rxjs@~5.0.2 but none was installed.
npm WARN adminwebapp@1.0.0 No repository field.

甚至我的用户界面也被扭曲了。更新这个的正确方法是什么?

控制台错误

ORIGINAL EXCEPTION: md-input-container must contain an mdInput directive. Did you forget to add mdInput to the native input or textarea element?
ErrorHandler.handleError @ :3002/node_modules/@angular/core/bundles/core.umd.js:3066
2017-03-08 17:18:29.656 :3002/node_modules/@angular/core/bundles/core.umd.js:3069 ORIGINAL STACKTRACE:
ErrorHandler.handleError @ :3002/node_modules/@angular/core/bundles/core.umd.js:3069
2017-03-08 17:18:29.656 :3002/node_modules/@angular/core/bundles/core.umd.js:3070 Error
    at MdInputContainerMissingMdInputError.ZoneAwareError (http://localhost:3002/node_modules/zone.js/dist/zone.js:958:33)
    at MdInputContainerMissingMdInputError.MdError [as constructor] (http://localhost:3002/node_modules/@angular/material/bundles/material.umd.js:994:16)
    at new MdInputContainerMissingMdInputError (http://localhost:3002/node_modules/@angular/material/bundles/material.umd.js:11238:16)
    at MdInputContainer.ngAfterContentInit (http://localhost:3002/node_modules/@angular/material/bundles/material.umd.js:11544:19)
    at CompiledTemplate.proxyViewClass.View_Toolbar0.detectChangesInternal (/AppModule/Toolbar/component.ngfactory.js:168:75)
    at CompiledTemplate.proxyViewClass.AppView.detectChanges (http://localhost:3002/node_modules/@angular/core/bundles/core.umd.js:12208:18)
    at CompiledTemplate.proxyViewClass.DebugAppView.detectChanges (http://localhost:3002/node_modules/@angular/core/bundles/core.umd.js:12355:48)
    at CompiledTemplate.proxyViewClass.AppView.internalDetectChanges (http://localhost:3002/node_modules/@angular/core/bundles/core.umd.js:12193:22)
    at CompiledTemplate.proxyViewClass.View_SideNav0.detectChangesInternal (/AppModule/SideNav/component.ngfactory.js:892:20)
    at CompiledTemplate.proxyViewClass.AppView.detectChanges (http://localhost:3002/node_modules/@angular/core/bundles/core.umd.js:12208:18)
    at CompiledTemplate.proxyViewClass.DebugAppView.detectChanges (http://localhost:3002/node_modules/@angular/core/bundles/core.umd.js:12355:48)
    at CompiledTemplate.proxyViewClass.AppView.internalDetectChanges (http://localhost:3002/node_modules/@angular/core/bundles/core.umd.js:12193:22)
    at CompiledTemplate.proxyViewClass.View_AppComponent0.detectChangesInternal (/AppModule/AppComponent/component.ngfactory.js:51:19)
    at CompiledTemplate.proxyViewClass.AppView.detectChanges (http://localhost:3002/node_modules/@angular/core/bundles/core.umd.js:12208:18)
    at CompiledTemplate.proxyViewClass.DebugAppView.detectChanges (http://localhost:3002/node_modules/@angular/core/bundles/core.umd.js:12355:48)
4

0 回答 0