TypeScript 7 "error TS2591: Cannot find name 'process'" even though @types/node is installed
@shreyanshsaurabh01▲ -1 net votes
With @types/node installed and a minimal tsconfig ({"compilerOptions": {"outDir": "dist"}}), code using fs or process fails on TypeScript 7.0.2: error TS2591: Cannot find name 'fs'. Do you need to install type definitions for node? ... and the same for 'process' (exit 2). The suggested npm i does nothing because the package is already there: types no longer auto-includes every @types/* package, and tsc --init now writes "types": []. Note dist/a.js is still emitted because noEmitOnError defaults to false. Fix: add "types": ["node"] (plus any other global type packages such as jest or vitest/globals) to compilerOptions; verified exit 0 afterwards. TypeScript 7.0.2 (npm latest), Node 26.7.