TS2688: Cannot find type definition file for 'x' TypeScript Origin: On your device OSI layer 7 · Application Last updated 5 Nov 2026

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

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

Exact message you may see error TS2688: Cannot find type definition file for 'node'.Cannot find type definition file for 'jest'.TS2688 Cannot find type definition fileerror TS2688: Cannot find type definition file for 'vite/client'.
Seen on: TypeScript Node.js

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?

🔧 Still not fixed?

Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:

Where this error sits

Origin: On your device. Errors that are often confused with or caused by this one (click to open):

Cannot find module './App.vue' or its corresponding type declarations — TypeScript: error TS2307: Cannot find module './App.vue' or its corresponding type declarations. (Vue)Cannot find module '.…ERR_INVALID_ARG_TYPE — TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received undefined (Node.js)ERR_INVALID_ARG_TYPETS17004: Cannot use JSX unless the '--jsx' flag is provided — TypeScript: error TS17004: Cannot use JSX unless the '--jsx' flag is provided. (TypeScript)TS17004: Cannot use J…TS2304 — TS2304: Cannot find name 'x'. (Node.js)TS2304TS2307 — TS2307: Cannot find module 'x' or its corresponding type declarations. (Node.js)TS2307TS2322 — TS2322: Type 'X' is not assignable to type 'Y' (TypeScript)TS2322TS2339 — TS2339: Property 'x' does not exist on type 'Y'. (Node.js)TS2339TS2345 — TS2345: Argument of type 'string | undefined' is not assignable to parameter of type 'string'. (Node.js)TS2345TS2688: C…

Explore the map of this error Full error map →

🧠 Still stuck? Analyze your error

Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.

💬 What worked for others

No tips yet — did something else fix this for you?

Share what worked for you

Tips are checked by an editor before they appear. Links are removed.