node.js - 打破 Node repl中的无限循环?

标签 node.js terminal

有没有办法打破 node.js REPL 中的无限循环?

例如,运行 while (true) {} 本质上会严重挂起 REPL,以至于 Ctrl-DCtrl-C 有任何影响。我发现唯一可行的方法是终止 Node 进程或关闭终端窗口。

看来应该有更好的方法。

最佳答案

是的,您必须终止进程,您可以为此使用进程管理器或在终端窗口中使用 Ctrl-C

Quitting node.js gracefully

关于node.js - 打破 Node repl中的无限循环?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28618075/

相关文章:

linux - 如何修改终端程序的选项?

powershell - VSCode - 在单独的窗口中打开终端

file - Unix shell 中文件路径中的单引号或无引号

javascript - socket.io - 发送到socketid(单个客户端)不工作

node.js - Node Mailer - 无法单击雅虎邮件中的链接

node.js - 连接已关闭 : Multiple node apps connecting to same MongoDB server using Mongoose

c++ - cout 在终端中不显示任何内容

linux - 命令 'c ..' 的作用是什么?

javascript - 在我的nodeJS应用程序中压平树上的空组

node.js - NodeJS 在 Docker 上安装