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.
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'. 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 installedtypesarray lists a missing package- Stale/missing node_modules
- typeRoots misconfigured
- Wrong working directory for tsc
⚡ Quick fix
npm i -D @types/node- Remove invalid entries from
"types" - Reinstall dependencies and check
typeRoots
Detailed fix by platform
Linux
npm i -D @types/node && npx tsc --noEmit
How to diagnose
- Package — Installed?
- types — Lists it?
- 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:
Similar errors
- Cannot find module './App.vue' or its corresponding type declarations TypeScript: error TS2307: Cannot find module './App.vue' or its corresponding type declarations.
- ERR_INVALID_ARG_TYPE TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received undefined
- TS17004: Cannot use JSX unless the '--jsx' flag is provided TypeScript: error TS17004: Cannot use JSX unless the '--jsx' flag is provided.
Most viewed in TypeScript
- TS2564 TS2564: Property 'x' has no initializer and is not definitely assigned in the constructor
- TS2366: Function lacks ending return statement TypeScript: error TS2366: Function lacks ending return statement and return type does not include 'undefined'.
- TS1259: Module can only be default-imported using the 'esModuleInterop' flag TypeScript: error TS1259: Module '"express"' can only be default-imported using the 'esModuleInterop' flag
Other ways to find it
Where this error sits
Origin: On your device. Errors that are often confused with or caused by this one (click to open):
🧠 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.
Report a correction or suggest an improvement
Last updated 5 Nov 2026