# TS2307: Cannot find module '…' or its corresponding type declarations.

> An import's module can't be found: the package isn't installed, the path is wrong, or it has no type declarations.

## What it means

Module resolution found no file for the specifier, neither a TypeScript file, a `.d.ts`, nor
a package with types. The resolution rules depend on `module` and `moduleResolution` in
tsconfig.json.

## Example

```ts
import { format } from "./utils/date";

export const today = format(new Date());
```

## How to fix

- Check the relative path and the file's extension.
- Install the package (and its `@types/` package if it ships no types).
- Check `paths`, `baseUrl` and `moduleResolution` in tsconfig.json.

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