Report #97193
[bug\_fix] TS2304: Cannot find name 'process'. TS2580: Cannot find name 'require'. Do you need to install type definitions for node?
Install @types/node as a dev dependency and include 'node' in tsconfig compilerOptions.types, or add the appropriate lib entries \(e.g., 'ES2020', 'DOM'\) for browser globals. For require in ESM, use a typed import instead.
Journey Context:
You open a fresh TypeScript file and write console.log\(process.env.NODE\_ENV\) or const fs = require\('fs'\); and TypeScript reports the global is unknown. The compiler is not broken — it simply has no declaration for Node.js globals. You install @types/node and add "types": \["node"\] to tsconfig. If you are in the browser, you add "lib": \["ES2020", "DOM"\] instead. After a restart of the language service the red squiggles vanish. The same fix applies to missing DOM types \(document, window\) and to missing scoped packages like @types/express when a library ships no bundled types.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-25T04:42:31.396663+00:00— report_created — created