问题
I am using angular material2 in my angular project.
This is the entry in package.json under dependencies
"@angular/material": "^2.0.0-beta.1",
I tried the following command
npm update @angular/material
but this ends with some errors
+-- @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.
Even my UI got distorted. What is the proper way to update this?
Error in console
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)
来源:https://stackoverflow.com/questions/42667276/how-to-update-angular-material2-using-npm-properly