Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Typescript, "process" does not exist

Tags:

node.js

I installed npm i @types/node but process still doesn't register as existing. What else do I need to do to have type definitions for node?

like image 756
Seph Reed Avatar asked Sep 11 '25 13:09

Seph Reed


1 Answers

You not only have to install the types for node (ie npm i @types/node), but you also have to list "node" under "types" in tsconfig.json

// example tsconfig.json
{
  "compilerOptions": {
    "module": "CommonJS",
    "target": "ES2018",
    "baseUrl": ".",
    "importHelpers": true,
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "types": ["node"]
  }
}
like image 161
Seph Reed Avatar answered Sep 14 '25 03:09

Seph Reed