简体   繁体   中英

Break infinite loop in node repl?

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.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM