8

Is there a way to break out of an infinite loop in the node.js REPL?

For example, running while (true) {} essentially hangs the REPL so intensely that no combination of Ctrl-D or Ctrl-C have any effect. The only thing I've found that works is to kill the node process or close the terminal window.

Seems like there should be a better way.

erikvold
  • 15,988
  • 11
  • 54
  • 98
joemaller
  • 19,579
  • 7
  • 67
  • 84
  • 3
    There is not. The REPL is busy, so it doesn't read input (`Ctrl-D`) or handle interrupts (`Ctrl-C`). It needs to be killed. – gdrooid Dec 30 '15 at 15:47

1 Answers1

-1

Yes you have to kill the process, you can use a process manager for that or Ctrl-C on the terminal window.

Quitting node.js gracefully

Community
  • 1
  • 1
erikvold
  • 15,988
  • 11
  • 54
  • 98