スーパーバイザーを使用して node.js を自動リロードしています。
supervisor -w . app.js
ただし、スーパーバイザーに node.js プロセスをデバッグで実行させる方法がわかりません。たとえば、次のようなものです。
node --debug app.coffee
誰でもアイデアはありますか?
スーパーバイザーを使用して node.js を自動リロードしています。
supervisor -w . app.js
ただし、スーパーバイザーに node.js プロセスをデバッグで実行させる方法がわかりません。たとえば、次のようなものです。
node --debug app.coffee
誰でもアイデアはありますか?
これも機能します (別の bash スクリプトは必要ありません)。
supervisor -- --debug app.js
supervisor -- --debug=7070 app.js
このソリューションは *nix で機能します:
/usr/local/bin
または $PATH の他のディレクトリに移動します
$ cd /usr/local/bin
次の内容の実行可能スクリプト (node-debug など) を作成します。
#!/bin/bash
node --debug $@
実行可能にするには:
$ sudo chmod 777 /usr/local/bin/node-debug
これで、次のようにスーパーバイザーを実行できます。
$ supervisor -x node-debug script.js
PS: 切り上げるには:
su
echo '#!/bin/bash
node --debug $@' > /usr/local/bin/node-debug
chmod 777 /usr/local/bin/node-debug
--nodejs ノード実行可能ファイルには、--debug、--debug-brk、--max-stack-size など、設定できる便利なオプションがいくつかあります。このフラグを使用して、オプションを Node.js に直接転送します。
私はこれを試してみましたが、うまくいきました:
スーパーバイザー -- --nodejs --debug app.coffee
次のように他の引数を追加できます。
スーパーバイザー -w 。-n エラー -- --nodejs --debug app.coffee
"All arguments are passed on to the child-process. node-dev --debug server.js will debug your application, not the supervisor itself."
Create a "test.js" node.js script in $HOME/nodetest
First terminal (run node in debug mode, debug will listen on the port 5858, node-dev will reload changed files):
cd $HOME/nodetest
npm install node-dev
node_modules/.bin/node-dev --debug test.js
Second terminal (start web inspector for a WebKit based browser, inspector connects to the port 5858 of the debugger and listens on the port 8080):
cd $HOME/nodetest
npm install node-inspector
node_modules/.bin/node-inspector
Open this URL in a WebKit based browser (Chrome, Safari, etc.):
http://0.0.0.0:8080/debug?port=5858
Click on "Scripts" and set breakpoints in your code.
github ページ-x
に記載されているフラグを使用します。node-supervisor
supervisor -w . -x 'node --debug' app.js
ただし、それはcoffeescriptでは機能しないため、使用する必要があります
supervisor -w . -x 'coffee --debug' app.js