# TypeScript: error TS2688: Cannot find type definition file for 'node'.

**Code:** `TS2688: Cannot find type definition file for 'x'` · **Category:** TypeScript · **Seen on:** TypeScript, Node.js

`types` in tsconfig (or auto-included `@types/*`) refers to a package that isn't installed.

## Meaning

Install it (`npm i -D @types/node`) or remove it from `compilerOptions.types`. If `types` is set, only listed packages load. In monorepos check hoisting and `typeRoots`. After deleting `node_modules`, run install again.

## Common causes

- `@types/node` (or other) not installed
- `types` array lists a missing package
- Stale/missing node_modules
- typeRoots misconfigured
- Wrong working directory for tsc

## Quick fix

1. `npm i -D @types/node`
2. Remove invalid entries from `"types"`
3. Reinstall dependencies and check `typeRoots`

## Detailed fix by platform

### Linux

1. `npm i -D @types/node && npx tsc --noEmit`

## How to diagnose

1. **Package** — Installed?
2. **types** — Lists it?
3. **Root** — typeRoots?

---
Source: [WhatIsMyError](https://whatismyerror.com/errors/typescript/ts2688-cannot-find-type-definition-file)
