【发布时间】:2012-02-10 14:01:42
【问题描述】:
节点可以使用这样的调试参数运行
$ node --debug src/file.js
我也可以像这样通过咖啡脚本二进制文件传递该参数
$ coffee --nodejs --debug src/file.coffee
哪个有效。但是当我涉及supervisor 时,事情变得更加困难。运行coffee脚本没问题:
$ supervisor -w src src/file.coffee
但我想调试使用supervisor 运行的咖啡脚本。如何通过supervisor 发送--debug 等参数?我尝试将可执行文件设置为带有如下参数的字符串:
$ supervisor -w src -x "coffee --nodejs --debug" src/server.coffee
这产生了一个无限重复的错误消息
调试:使用 'coffee --nodejs --debug src/server.coffee' 启动子进程 调试:execvp():没有这样的文件或目录
这很奇怪,因为在终端中运行 coffee --nodejs --debug src/server.coffee 有效。
那么如何通过supervisor 发送参数?
编辑:我想扩展我的问题,提到我现在也尝试使用nodemon。似乎nodemon 被认为比node-supervisor 更可取,所以我会接受任何解释在通过nodemon 启动咖啡脚本时如何将--debug 传递给节点进程的答案
编辑:这是nodemon 的输出。显然,参数的传递顺序不同:-(
$ nodemon -w src -x 咖啡 --nodejs --debug src/server.coffee 1 月 15 日 03:41:56 - [nodemon] v0.6.5 1 月 15 日 03:41:56 - [nodemon] 观看:/foo/bar/server/src 1 月 15 日 03:41:56 - [nodemon] 正在运行 --debug 1 月 15 日 03:41:56 - [nodemon] 开始`coffee --debug --nodejs src/server.coffee` 节点.js:201 扔 e; // process.nextTick 错误,或第一次滴答时的 'error' 事件 ^ 错误:无法识别的选项:--debug【问题讨论】:
-
这里是新节点。关于为什么 nodemon 比主管更可取的任何细节?我注意到的一件事是,在崩溃之后,并没有疯狂地尝试重新启动。
标签: node.js debugging coffeescript nodemon node-supervisor