Using Angular 6, I am having trouble with my material-moment-adapter. In my moment-date-adapter.d.ts file it shows that "'module' cannot be found" on my import statements when trying to import { Moment } from
node_modules/@angular/material-moment-adapter/typings/adapter/moment-date-adapter.d.ts.
My tsconfig.json is as follows:
{
  "compileOnSave": false,
  "compilerOptions": {
    "baseUrl": "./",
    "outDir": "./dist/out-tsc",
    "sourceMap": true,
    "declaration": false,
    "module": "es2015",
    "moduleResolution": "node",
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "target": "es5",
    "typeRoots": [
      "node_modules/@types"
    ],
    "lib": [
      "es2017",
      "dom"
    ] 
  }
}
My import statement is simply
import { Moment } from 'moment';
from my moment-date-adapter.d.ts file.
Any help would be appreciated.
Installing @types/moment as a dev dependency solved it for me.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With