有没有可能调试Node REPL。Node命令行会带来REPL提示符>。在提示符中,是否可以启动调试器。例如:
> hello = function(){
....debugger;
....console.log('hello');
}
>hello() --> should run in the debugger..
有没有可能调试Node REPL。Node命令行会带来REPL提示符>。在提示符中,是否可以启动调试器。例如:
> hello = function(){
....debugger;
....console.log('hello');
}
>hello() --> should run in the debugger..
node --debug
已被标记为弃用。
[DEP0062] DeprecationWarning:
node --debug
和node --debug-brk
是无效的。请改用node --inspect
或node --inspect-brk
。
node --inspect
是未来的方式。
使用 node --debug
启动 repl。然后,您可以从单独的终端使用 node-inspector
(一个 npm 包),并通过在 chrome 中打开 http://localhost:8080/debug?port=5858
在浏览器中使用 chrome 开发人员工具进行调试。例如,您可以在 complete
函数的 repl.js
文件中设置断点,如果您转到 node repl 并按下 TAB
,它将触发断点,您可以对其进行调试。
如果您想要 coffee-script repl,则为 coffee --nodejs --debug
。