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:
- In the terminal, execute npm install @angular/material @angular/cdk @angular/animations hammerjs
- 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 ...