Manually

We will begin by installing all required libraries. As of Angular 5, the major version of Angular Material should match the version of your Angular installation and with Angular 6, the versions should be synced:

  1. In the terminal, execute npm install @angular/material @angular/cdk @angular/animations hammerjs
  2. Observe package.json versions:
package.json "dependencies": {    "@angular/animations": "6.0.0",    "@angular/cdk": "6.0.0",    "@angular/material": "6.0.0",    "hammerjs": "^2.0.8",    ...

In this case, all libraries have the same major and minor version at 5.0. If your major and minor versions don't match, you can rerun the npm install command to install a specific version or choose to upgrade your version of Angular by appending the semver ...

Get Angular 6 for Enterprise-Ready Web Applications now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.