我安装了Angular Material并在控制台上发现了几个警告.我有不兼容或缺少的库吗?
c:/...>npm install --save @angular/material @angular/cdk npm WARN @angular/cdk@6.1.0 requires a peer of @angular/core@>=6.0.0-beta.0 <7.0.0 but none is installed. You must install peer dependencies yourself. npm WARN @angular/cdk@6.1.0 requires a peer of @angular/common@>=6.0.0-beta.0 <7.0.0 but none is installed. You must install peer dependencies yourself. npm WARN @angular/material@6.1.0 requires a peer of @angular/core@>=6.0.0-beta.0 <7.0.0 but none is installed. You must install peer dependencies yourself. npm WARN @angular/material@6.1.0 requires a peer of @angular/common@>=6.0.0-beta.0 <7.0.0 but none is installed. You must install peer dependencies yourself. npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@1.1.3 (node_modules\fsevents): npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@1.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"}) + @angular/cdk@6.1.0 + @angular/material@6.1.0 added 2 packages in 42.598s
你在6.1.0中使用@ angular / material.此版本旨在与Angular 6一起使用.看起来您使用的是早期的Angular版本.
原文链接:https://www.f2er.com/angularjs/141229.html对于Angular 5,您可以通过更新package.json来使用版本5.x.x中的@ angular / material,如下所示:
"dependencies": { ... "@angular/cdk": "^5.2.5","@angular/material": "^5.2.5",... },