How to fix npm ERR! code ELIFECYCLE npm ERR! errno SIGINT npm ERR! process terminated with signal SIGINT in npm

npmBEGINNERLOWUpdated Dec 6, 2025· 192 views

SIGINT errors occur when an npm script is interrupted, typically by Ctrl+C. This is usually normal behavior, not an actual error—npm reports non-zero exits from interrupted processes.

Quick fix

Fixes npm ERR! code ELIFECYCLE npm ERR! errno SIGINT npm ERR! process terminated with signal SIGINT

# Running dev server
npm run dev
# ... server running ...

# Press Ctrl+C
^C
npm ERR! code ELIFECYCLE
npm ERR! errno SIGINT
  1. Understand this is often normal
  2. Add graceful shutdown handlers
  3. Run Node directly for better signal handling
  4. Suppress error output in scripts
npm — error
# Running dev server
npm run dev
# ... server running ...
# Press Ctrl+C
^C
npm ERR! code ELIFECYCLE
npm ERR! errno SIGINT
npm ERR! code ELIFECYCLE
npm ERR! errno SIGINT
npm ERR! process terminated with signal SIGINT

What this error means

SIGINT (signal 2) is the interrupt signal, typically sent when you press Ctrl+C in the terminal. When npm reports this as an error, it's because the child process exited with a non-zero status code (130 = 128 + 2). In most cases, this is expected behavior—you intentionally stopped the process. npm reports it as an error because any non-zero exit code is technically a failure. The "error" message can be safely ignored when you deliberately interrupted the process.

Typical symptoms

  • Pressing Ctrl+C during npm start shows ELIFECYCLE error
  • Error appears after intentionally stopping a dev server
  • CI/CD shows "signal SIGINT" when job is cancelled
  • Process exits with code 130
  • Need to press Ctrl+C twice to fully exit
  • Graceful shutdown handlers don't execute

Common causes

  1. User pressed Ctrl+C to stop the process (intentional)
  2. CI/CD pipeline was cancelled or timed out
  3. Parent process sent interrupt signal
  4. npm doesn't forward SIGINT cleanly to child processes
  5. Docker/container orchestration stopping the container
  6. IDE or terminal emulator sending interrupt

How to fix "npm ERR! code ELIFECYCLE npm ERR! errno SIGINT npm ERR! process terminated with signal SIGINT"

1Understand this is often normal

If you pressed Ctrl+C, this "error" is expected:

bash
# Running dev server
npm run dev
# ... server running ...

# Press Ctrl+C
^C
npm ERR! code ELIFECYCLE
npm ERR! errno SIGINT

The process stopped as requested. The error message is just npm reporting the non-zero exit code.

2Add graceful shutdown handlers

If you need cleanup on Ctrl+C:

javascript
process.on('SIGINT', async () => {
  console.log('\nReceived SIGINT. Cleaning up...');

  // Close connections, save state, etc.
  await cleanup();

  // Exit cleanly
  process.exit(0);
});

Use process.once('SIGINT', ...) to avoid double handling.

3Run Node directly for better signal handling

npm has known issues forwarding signals:

bash
# Instead of
npm run dev

# Run directly
node --watch src/index.js
# or
npx tsx watch src/index.ts

Direct execution gives you cleaner signal handling.

4Suppress error output in scripts

If the error message bothers you, handle it in the script:

json
{
  "scripts": {
    "dev": "node server.js || true"
  }
}

The || true prevents the non-zero exit from showing as error. Use carefully—it hides real errors too.

5Fix double Ctrl+C requirement

If you need to press Ctrl+C twice:

javascript
// Force exit on second SIGINT
let isShuttingDown = false;

process.on('SIGINT', () => {
  if (isShuttingDown) {
    console.log('Force exit');
    process.exit(1);
  }

  isShuttingDown = true;
  console.log('Shutting down gracefully... (Ctrl+C again to force)');

  // Graceful shutdown
  server.close(() => process.exit(0));
});
6Handle in CI/CD pipelines

For cancelled CI jobs, handle gracefully:

GitHub Actions:

yaml
jobs:
  build:
    runs-on: ubuntu-latest
    timeout-minutes: 10  # Set reasonable timeout
    steps:
      - run: npm test
        continue-on-error: true  # Don't fail on interrupt

Check if the job was cancelled vs actually failed in your script logic.

Advanced notes

The SIGINT "error" is a cosmetic issue in npm. The npm team has discussed this but hasn't changed the behavior because technically any non-zero exit is a failure.

On Windows, signal handling works differently. Ctrl+C sends a different event, and SIGINT may not behave the same as on Unix systems. Use Ctrl+Break for harder interrupts on Windows.

For development servers like Next.js, Vite, or webpack-dev-server, this error on Ctrl+C is completely normal and expected. These tools handle their own cleanup before exiting.

Frequently asked questions

What does "npm ERR! code ELIFECYCLE npm ERR! errno SIGINT npm ERR! process termin" mean?
SIGINT (signal 2) is the interrupt signal, typically sent when you press Ctrl+C in the terminal. When npm reports this as an error, it's because the child process exited with a non-zero status code (130 = 128 + 2). In most cases, this is expected behavior—you intentionally stopped the process.
How do I fix "npm ERR! code ELIFECYCLE npm ERR! errno SIGINT npm ERR! process termin"?
SIGINT errors occur when an npm script is interrupted, typically by Ctrl+C. This is usually normal behavior, not an actual error—npm reports non-zero exits from interrupted processes.
What causes "npm ERR! code ELIFECYCLE npm ERR! errno SIGINT npm ERR! process termin"?
User pressed Ctrl+C to stop the process (intentional) CI/CD pipeline was cancelled or timed out Parent process sent interrupt signal
Is the "npm ERR! code ELIFECYCLE npm ERR! errno SIGINT npm ERR! process termin" error serious?
It is a low-severity error — more of a blocker than a risk. The steps above resolve it.

Official resources & further reading