How to import moment types definitions
I've been using moment
in TypeScript (IntelliJ) with no extra work to install typings for it.
Here's the relevant configuration:
- Inside
tsconfig.json
:"moduleResolution": "Node"
- No
"types"
section at all
./package.json
has no@types/moment
- Inside
./node_modules/moment/
:./moment.d.ts
exists./package.json
has"typings": "./moment.d.ts"
./package.json
is"version": "2.14.1"
When I switch back to "moduleResolution": "Classic"
, TypeScript says cannot find module 'moment'
. So that is probably the culprit.