TS2307

Cannot find module 'events' or its corresponding type declarations.

Broken Code ❌

You are importing from a core Node.js module (e.g. event) without having Node.js type definitions installed:

import { EventEmitter } from 'events';

Fixed Code ✔️

Import Node.js type definitions first in order to use Node.js core modules:

npm install @types/node

Read More: Cannot find module events