I'm trying to use EventEmmiter3 with the following syntax:
import EventEmitter from 'eventemitter3'
I have this module installed under the ./node_modules folder. This module contains a index.d.ts so I think it should be detected by Typescript. But instead get the error:
[ts] Cannot find module 'eventemitter3'.
I tried adding ./node_modules to the included types in my tsconfig.json without success:
{
"compilerOptions": {
"typeRoots": ["./node_modules", "./node_modules/@types"]
}
}
How should I configure Typescript to find node modules?
import * as EventEmitter from 'eventemitter3'import {EventEmitter} from 'eventemitter3'. I guess it's really just a case by case solution. Thank you!