Cannot find module '@angular/material-moment-adapter'

Curtis picture Curtis · Dec 14, 2017 · Viewed 41.2k times · Source

Why is this not working? I try importing the MomentDateAdapter as shown on the angular website but Visual Studio Code keeps complaining it cant find @angular/material-moment-adapter. What am I doing wrong?

version info: Angular CLI: 1.5.0 Node: 6.11.0 OS: darwin x64 Angular: 4.4.6 ... animations, common, compiler, compiler-cli, core, forms ... http, language-service, platform-browser ... platform-browser-dynamic, router, tsc-wrapped

@angular/cdk: 2.0.0-beta.12 @angular/cli: 1.5.0 @angular/material: 2.0.0-beta.12 @angular-devkit/build-optimizer: 0.0.32 @angular-devkit/core: 0.0.20 @angular-devkit/schematics: 0.0.35 @ngtools/json-schema: 1.1.0 @ngtools/webpack: 1.8.0 @schematics/angular: 0.1.1 typescript: 2.3.4 webpack: 3.8.1

Answer

xudre picture xudre · Jun 6, 2018

For those, like me, that also reached this question and already have the lastest @angular 5+.

Don't forget to install Moment.js: npm i moment (as I did )