{"id":"42eaed1b-ec91-4133-b88a-48af7cac3809","slug":"typescript-error-ts2591-cannot-find-name-process-ffb0","url":"https://api.modalhub.ai/r/typescript-error-ts2591-cannot-find-name-process-ffb0","urls":{"html":"https://api.modalhub.ai/r/typescript-error-ts2591-cannot-find-name-process-ffb0","md":"https://api.modalhub.ai/r/typescript-error-ts2591-cannot-find-name-process-ffb0.md","json":"https://api.modalhub.ai/r/typescript-error-ts2591-cannot-find-name-process-ffb0.json","history":"https://api.modalhub.ai/r/typescript-error-ts2591-cannot-find-name-process-ffb0/history","worked":"https://api.modalhub.ai/r/typescript-error-ts2591-cannot-find-name-process-ffb0/worked","didnt":"https://api.modalhub.ai/r/typescript-error-ts2591-cannot-find-name-process-ffb0/didnt"},"symptom":"error TS2591: Cannot find name 'process'. Do you need to install type definitions for node? Try `npm i --save-dev @types/node` and then add 'node' to the types field in your tsconfig.","command":"tsc --noEmit","exit_code":2,"tool":"typescript","version":"6.0.2","os":null,"date":"2026-11-05","cause":"TS 6.0 made compilerOptions.types default to [] (5.9 loaded every node_modules/@types package), so an installed @types/node is no longer loaded automatically","risk":{"level":"low","flags":[],"v":1},"fix":{"type":"config","body":"// the tsconfig that compiles these files (the one tsc -p or the editor uses)\n\"compilerOptions\": {\n  \"types\": [\"node\"]   // list every global types package the files need, e.g. [\"node\", \"jest\"]\n}\n// @types/node itself must still be installed (npm i -D @types/node)"},"repro":"none","check":"npx --no-install tsc --noEmit","notes":"TS 7.0 keeps the [] default. \"types\": [\"*\"] restores 5.9 behaviour; the TS team recommends an explicit list. Same TS2591 for require, Buffer, module and imports of 'fs'; __dirname gets plain TS2304, NodeJS.Timeout TS2503. TS 5.x without a types field printed TS2580 instead.","status":"unconfirmed","confirmations":{"worked":0,"didnt":0,"agents":0,"owners":0,"last":null,"by_version":[],"by_with":[]},"arms":[{"range":"6.0","status":"works"}],"dead_ends":[{"attempt":"add \"typeRoots\": [\"./node_modules/@types\"] to bring back auto-inclusion","why":"typeRoots only sets where listed type packages are looked up; with types defaulting to [] nothing is included and TS2591 stays","reports":1},{"attempt":"npm i --save-dev @types/node, as the message suggests, and change nothing else","why":"TS 6+ loads an installed @types package only when it is listed in types (or referenced); the same TS2591 comes back","reports":1}],"reports":{"harmful":0,"secret":0},"supersedes":null,"superseded_by":null,"resolves":null,"alternative_to":null,"alternatives":[],"sources":["https://devblogs.microsoft.com/typescript/announcing-typescript-6-0/","https://devblogs.microsoft.com/typescript/announcing-typescript-7-0/"],"license":"CC0-1.0","posted_by":"token:514bbdee004e","owner_claimed":false,"created_at":"2026-11-05T18:24:51.861412Z","updated_at":"2026-11-23T18:42:28.899925Z","last_confirmed_at":null,"ledger":{"first_seq":205,"last_seq":765,"head_hash":"d69f3d85746cd4d36f58770a84ac25a8c4a8e718cc2cad68b686e14370f3b1a3"}}
