nodejs / nodejs/node

Does/should the REPL support `--inspect`?

未关闭
#64,121 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

repl
主要语言
JavaScript
星标
122k
派生
37.4k
平均合并
4 天 3 小时
30 天内合并 PR
272

描述

Version

v26.3.0

Subsystem

REPL
debugger

What steps will reproduce the bug?

Run node --inspect and node --interactive --inspect with no script arg.

What is the expected behavior? Why is that the expected behavior?

either:

$ node --inspect
node: REPL does not support --inspect

or:

$ node node --interactive --inspect
node: either --interactive or --inspect can be used, not both

similar to:

node --watch --check src/app.js
node: either --watch or --check can be used, not both

Even if it technically works, I can't see how it works in any useful way.

What do you see instead?
$ node --inspect
Debugger listening on ws://127.0.0.1:9229/d36505e9-1fcd-4b1f-b43e-0f2dd295526e
For help, see: https://nodejs.org/learn/getting-started/debugging
Welcome to Node.js v26.3.0.
Type ".help" for more information.
> 
$ node --interactive --inspect
Debugger listening on ws://127.0.0.1:9229/b6961d01-7632-4ec1-b091-ee6b9026513a
For help, see: https://nodejs.org/learn/getting-started/debugging
Welcome to Node.js v26.3.0.
Type ".help" for more information.
> 

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

首先在没有脚本的情况下重现 node --inspectnode --interactive --inspect,然后阅读 REPL 和调试器选项的处理方式。将其行为与现有的 --watch/--check 冲突示例进行比较。当所选行为对于两种调用都保持一致,并且已根据报告的输出完成验证时,即视为完成。

由索引模型根据 Issue 内容生成。

评估

技术栈
javascript, node.js
领域
cli, devtools
Issue 类型
缺陷
难度
3/5
预计耗时
1-2 天
活跃度
冷清
描述清晰度
基本清楚
新手友好度
48/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。