Exit code 134 indicates SIGABRT (abort signal), typically caused by JavaScript heap out of memory during npm install or build. Increase Node.js memory allocation to resolve this.
Fixes npm ERR! code ELIFECYCLE npm ERR! errno 134 npm ERR! Exit status 134
# Linux/macOS
export NODE_OPTIONS="--max-old-space-size=4096"
npm run build
# Windows Command Prompt
set NODE_OPTIONS=--max-old-space-size=4096
npm run build
# Windows PowerShell
$env:NODE_OPTIONS="--max-old-space-size=4096"
npm run build# Linux/macOSexport NODE_OPTIONS="--max-old-space-size=4096"npm run build# Windows Command Promptset NODE_OPTIONS=--max-old-space-size=4096npm run build# Windows PowerShell$env:NODE_OPTIONS="--max-old-space-size=4096"npm run buildnpm ERR! code ELIFECYCLEnpm ERR! errno 134npm ERR! Exit status 134
Exit code 134 is calculated as 128 + 6, where 6 is the SIGABRT (abort) signal number. This error occurs when the Node.js process terminates abnormally, almost always due to running out of memory. The most common scenario is the "JavaScript heap out of memory" error during large builds, dependency installations in monorepos, or webpack compilations. The Node.js process exhausts its allocated memory and aborts. You'll often see "FATAL ERROR: Reached heap limit Allocation failed" in the output before the ELIFECYCLE message.
The primary fix—allocate more memory to Node.js:
# Linux/macOS
export NODE_OPTIONS="--max-old-space-size=4096"
npm run build
# Windows Command Prompt
set NODE_OPTIONS=--max-old-space-size=4096
npm run build
# Windows PowerShell
$env:NODE_OPTIONS="--max-old-space-size=4096"
npm run buildCommon values: 4096 (4GB), 8192 (8GB). Don't exceed your system RAM.
Make the fix permanent in your project:
{
"scripts": {
"build": "node --max-old-space-size=4096 node_modules/.bin/webpack",
"build:prod": "NODE_OPTIONS=--max-old-space-size=4096 react-scripts build"
}
}Reset npm state before retrying:
# Delete existing artifacts
rm -rf node_modules package-lock.json
# Clear npm cache
npm cache clean --force
# Use npm ci for cleaner install
npm ci32-bit Node.js has lower memory limits:
# Check Node.js architecture
node -p "process.arch"
# Should output: x64
# If it shows x86 or ia32, reinstall 64-bit version
# On Windows, download x64 installer from nodejs.org
# On Linux/macOS with nvm:
nvm install node --reinstall-packages-from=nodeIf running in Docker, allocate more memory:
# Run container with 4GB memory
docker run --memory=4g myimage
# In docker-compose.yml
services:
app:
mem_limit: 4gAlso increase Docker Desktop's VM memory in Settings → Resources.
On Linux, insufficient file watchers can cause related issues:
# Check current limit
cat /proc/sys/fs/inotify/max_user_watches
# Increase temporarily
echo 65536 | sudo tee /proc/sys/fs/inotify/max_user_watches
# Make permanent
echo "fs.inotify.max_user_watches=65536" | sudo tee -a /etc/sysctl.conf
sudo sysctl -pFor CI/CD pipelines with memory constraints, consider splitting builds or using incremental compilation. Webpack's cache option and Next.js's incremental builds reduce memory usage.
If using node-sass (deprecated), migrate to Dart Sass which doesn't have the same native compilation memory issues:
npm uninstall node-sass
npm install sassFor Angular projects, the Angular CLI has its own memory management. Use the --configuration=production flag which enables ahead-of-time compilation and may use memory more efficiently.