# @pnpm/error

> An error class for pnpm errors

Latest version **1100.1.4** (published 2026-09-06) · MIT license · 0 weekly downloads

## Install

```sh
npm install @pnpm/error
pnpm add @pnpm/error
yarn add @pnpm/error
bun add @pnpm/error
```

## Health

**Score 80/100 (A)** — status: active.

Positive: has types; esm support; no vulnerabilities; has provenance; recently updated; high maintenance score; high quality score; popular repo.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 1100.1.4 |
| Published | 2026-09-06 |
| First published | 2019-07-30 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=22.13 |
| Dependencies | 1 |
| Unpacked size | 15.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 36327 |
| Maintainers | pnpmuser, zkochan |
| Keywords | pnpm, pnpm11, error |

## Links

- npm: https://www.npmjs.com/package/@pnpm/error
- Repository: https://github.com/pnpm/pnpm/tree/main/pnpm11/core/error
- Homepage: https://github.com/pnpm/pnpm/tree/main/pnpm11/core/error#readme
- Issues: https://github.com/pnpm/pnpm/issues
- Funding: https://opencollective.com/pnpm
- npm.io page: https://npm.io/package/@pnpm/error

## Dependencies (1)

- [@pnpm/constants](https://npm.io/package/@pnpm/constants.md) 1102.0.0

## Alternatives

- [@sentry/react-native](https://npm.io/package/@sentry/react-native.md) — 2.6M weekly downloads
- [@ardatan/aggregate-error](https://npm.io/package/@ardatan/aggregate-error.md) — 708.1K weekly downloads
- [custom-error-generator](https://npm.io/package/custom-error-generator.md) — 2.0K weekly downloads
- [@technik-sde/prosemirror-recreate-transform](https://npm.io/package/@technik-sde/prosemirror-recreate-transform.md) — 1.5K weekly downloads
- [@suchipi/error-utils](https://npm.io/package/@suchipi/error-utils.md) — 78 weekly downloads

## Recent versions

- 1100.1.4 (latest) — 2026-09-06
- 0.0.0-20230605-20230605142810 (dev) — 2023-06-05
- 1.3.0 (pnpm-temp) — 2020-08-16
- 1100.1.3 — 2026-08-23
- 1100.1.2 — 2026-08-15
- 1100.1.1 — 2026-08-03
- 1100.1.0 — 2026-07-23
- 1100.0.1 — 2026-06-23
- 1100.0.0 — 2026-04-10
- 1000.1.0 — 2026-03-24
- 1000.0.5 — 2025-09-13
- 1000.0.4 — 2025-07-31
- 1000.0.3 — 2025-07-23
- 1000.0.2 — 2025-01-26
- 1000.0.1 — 2024-12-16
- … 23 more at https://npm.io/package/@pnpm/error/versions

## README

# @pnpm/error

> An error class for pnpm errors

<!--@shields('npm')-->
[![npm version](https://img.shields.io/npm/v/@pnpm/error.svg)](https://npmx.dev/package/@pnpm/error)
<!--/@-->

## Installation

```sh
pnpm add @pnpm/error
```

### Usage

```ts
import { PnpmError } from '@pnpm/error'

try {
    throw new PnpmError('THE_ERROR_CODE', 'The error message')
} catch (err: any) { // eslint-disable-line
    console.log(err.code)
    //> ERR_PNPM_THE_ERROR_CODE
    console.log(err.message)
    //> The error message
}
```

## License

MIT

---
_Source: https://npm.io/package/@pnpm/error · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
