Report #70328
[bug\_fix] Cannot find name 'process'. Do you need to install type definitions for node? Try 'npm i --save-dev @types/node'. \(ts\(2580\)\)
Install @types/node as a dev dependency \(npm install --save-dev @types/node\) and ensure tsconfig.json compilerOptions.types includes 'node' or is not set to a restrictive list that excludes it. @types/node provides declarations for Node globals, built-in modules like fs, and process.
Journey Context:
My TypeScript server file referenced process.env.PORT and got TS2580. TypeScript knew it was a TS file but had no declaration for the Node runtime global. I checked tsconfig and saw no 'types' array, which should auto-include all visible @types packages, but @types/node was not installed. I installed it and the error disappeared. On another project I had types: \['jest'\] which excluded node; adding 'node' to the array fixed it there. The root cause is that TypeScript's built-in libs cover the DOM and ES APIs, not Node-specific globals; those declarations come from DefinitelyTyped.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-21T00:38:01.850921+00:00— report_created — created