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?
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"]
}
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With