TypeScript Diagnostic

How to Fix TypeScript Error TS2304: "Cannot find name 'name'"

The TypeScript compiler does not recognize an identifier because it has not been declared, imported, or included in tsconfig.json lib/types definitions.

TS2304: Cannot find name

Quick Fix Checklist

  1. For Node.js globals (process, Buffer): npm i -D @types/node
  2. For test runners (describe, test, expect): npm i -D @types/jest or @types/mocha
  3. In tsconfig.json: Ensure "lib": ["DOM", "DOM.Iterable", "ESNext"] is configured