TypeScript error: Cannot find module 'moment'

You have to install a package before actually using it in your code. So you can Install moment library using npm (node package manager)

npm install moment

and then import this library

import * as moment from 'moment'

Then you are good to go.


Update

moment version 2.25.1 is released. This fixes the issue.

Old Answer

It's an issue of moment version 2.25.0,

https://github.com/moment/moment/issues/5486

Delete your package-lock.json and node_modules folder, replace this line of code in your package.json

"moment": "2.24.0",

note, remove the ^, else it will keep installing 2.25.0

then npm install

This should resolve the issue.