# TS2591: Cannot find name '…'. 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.

> A Node.js global such as process or require isn't known. Install @types/node and add "node" to the types option in tsconfig.json.

## What it means

The name is a Node.js global (`process`, `require`, `Buffer`, `__dirname` and so on), and no
type definitions for Node are loaded in the project.

## Example

```ts
const env = process.env.HOME;
export {};
```

## How to fix

- Install the Node type definitions: `npm i --save-dev @types/node`.
- If `tsconfig.json` sets `types`, add `"node"` to it.
- If the code isn't meant to run on Node, use the equivalent API of its real environment.

Source: https://ts-r.dev/errors/TS2591/
