是否可以调试 NODE REPL。node cmd 带来 repl 提示 >. 在提示符下可以启动调试器。比如说
> hello = function(){
....debugger;
....console.log('hello');
}
>hello() --> should run in the debugger..
是否可以调试 NODE REPL。node cmd 带来 repl 提示 >. 在提示符下可以启动调试器。比如说
> hello = function(){
....debugger;
....console.log('hello');
}
>hello() --> should run in the debugger..
node --debug
被标记为弃用。
[DEP0062] 弃用警告:
node --debug
并且node --debug-brk
无效。请使用node --inspect
ornode --inspect-brk
代替。
node --inspect
是前进的方向。
用node --debug
. 然后,您可以node-inspector
从单独的终端使用(一个 npm 包),并通过在 chrome 中打开使用 chrome 开发人员工具在浏览器中进行调试http://localhost:8080/debug?port=5858
。例如,你可以repl.js
在函数中的文件中设置断点complete
,如果你去节点 repl 并点击TAB
它,它会触发断点,你可以调试它。
如果你想要咖啡脚本 repl,它是coffee --nodejs --debug
.