Mer*_*erc 48 debugging node.js
我正在尝试使用节点调试器.我正在node debug server运行我的服务器.然后我有:
...
var Workspace = mongoose.model('Workspace');
debugger;
Run Code Online (Sandbox Code Playgroud)
此时,正如预期的那样,当我运行此代码时,调试器会弹出.但是,我希望它能够设置所有当前变量,就像在Chrome自己的调试器中一样.
但:
break in hotplate/node_modules/bd/lib/bd.js:133
132
133 debugger;
134
135 // Delete the ID and the version since there's no point,
debug> Workspace
ReferenceError: Workspace is not defined
Run Code Online (Sandbox Code Playgroud)
那么......我如何实际检查当前变量?
额外的问题:有没有办法使用Chrome的开发人员工具(CTRL-J),以便它连接到节点并以这种方式工作?(我知道节点检查员,但它已经过时了......)
And*_*rov 78
使用repl命令(参见文档中的第三个示例)
break in hotplate/node_modules/bd/lib/bd.js:133
132
133 debugger;
134
135 // Delete the ID and the version since there's no point,
debug> repl
Press Ctrl + C to leave debug repl
> Workspace
Run Code Online (Sandbox Code Playgroud)
更新:奖金问题 - https://github.com/c4milo/node-webkit-agent
奖金问题的答案在 2018 年发生了变化。
跑步node inspect foo.js。
访问chrome://inspect并在设备列表中您应该看到一个Target (<process.version>)带有随附检查链接的条目。
| 归档时间: |
|
| 查看次数: |
17102 次 |
| 最近记录: |