# increase-memory-limit

> Increase memory limit for local node binaries ('max-old-space-size')

Latest version **1.0.7** (published 2019-05-27) · ISC license · 0 weekly downloads

## Install

```sh
npm install increase-memory-limit
pnpm add increase-memory-limit
yarn add increase-memory-limit
bun add increase-memory-limit
```

Provides the command `increase-memory-limit`.

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.7 |
| Published | 2019-05-27 |
| First published | 2017-03-02 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 270 |
| Author | Endel Dreyer |
| Maintainers | endel |

## Links

- npm: https://www.npmjs.com/package/increase-memory-limit
- Repository: https://github.com/endel/increase-memory-limit
- Homepage: https://github.com/endel/increase-memory-limit#readme
- Issues: https://github.com/endel/increase-memory-limit/issues
- npm.io page: https://npm.io/package/increase-memory-limit

## Dependencies (1)

- [glob](https://npm.io/package/glob.md) ^7.1.1

## Recent versions

- 1.0.7 (latest) — 2019-05-27
- 1.0.6 — 2017-11-29
- 1.0.5 — 2017-11-03
- 1.0.4 — 2017-09-22
- 1.0.3 — 2017-09-08
- 1.0.2 — 2017-08-18
- 1.0.1 — 2017-03-02
- 1.0.0 — 2017-03-02

## README

# DEPRECATION NOTICE

As of Node.js v8.0 shipped August 2017, you can now use the `NODE_OPTIONS`
environment variable to set the max_old_space_size globally. ([#19](https://github.com/endel/increase-memory-limit/issues/19))

```
export NODE_OPTIONS=--max_old_space_size=4096
```

increase-memory-limit
===

Workaround to fix `heap out of memory` when running node binaries. It's a common
issue when using TypeScript 2.1+ and webpack.

This tool will append `--max-old-space-size=4096` in all `node` calls inside
your `node_modules/.bin/*` files.

```
FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
```

How to use
---

```
npm install -g increase-memory-limit
```

Run from the root location of your project:

```
increase-memory-limit
```

Running from NPM task
---

Alternatively, you can configure a npm task to run the fix.

```javascript
// ...
  "scripts": {
    "fix-memory-limit": "cross-env LIMIT=2048 increase-memory-limit"
  },
  "devDependencies": {
    "increase-memory-limit": "^1.0.3",
    "cross-env": "^5.0.5"
  }
// ...
```

```
npm run fix-memory-limit
```

License
---

MIT

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