nodejitsu/forever — Issue #226: Argument parse error with script-options
Author: mikl
Created: 2012-01-14 21:24:20+00:00
State: open

I am running into an argument parse error when trying to use the -w/--watch feature of forever.

This works (`runserver` is an argument to `bin/ardon`):

% ./node_modules/.bin/forever bin/ardon runserver
info: Server listening at port 7000

This however does not:

% ./node_modules/.bin/forever -w bin/ardon runserver
error: Cannot start forever
error: script /Users/mikl/Work/Node/ardon/runserver does not exist.

And neither does this:

% ./node_modules/.bin/forever --watch bin/ardon runserver
error: Cannot start forever
error: script /Users/mikl/Work/Node/ardon/runserver does not exist.

And this one goes completely off the rails:

% ./node_modules/.bin/forever --watch start bin/ardon runserver (git:develop)
{
"process": {
"pid": 34830,
"uid": 502,
"gid": 502,
"cwd": "/Users/mikl/Work/Node/ardon",
"execPath": "/usr/local/Cellar/node/0.6.7/bin/node",
"version": "v0.6.7",
"argv": [
"node",
"/Users/mikl/Work/Node/ardon/node_modules/.bin/forever",
"--watch",
"start",
"bin/ardon"
],
"memoryUsage": {
"rss": 26247168,
"heapTotal": 16557184,
"heapUsed": 7162352
}
},
"os": {
"loadavg": [
1.1357421875,
1.455078125,
1.48828125
],
"uptime": 164114
},
"trace": [
{
"column": 7,
"file": "/Users/mikl/Work/Node/ardon/node_modules/forever/lib/forever/plugins/watch.js",
"function": null,
"line": 34,
"method": null,
"native": false
},
{
"column": 5,
"file": "Object]. (fs.js",
"function": "[object",
"line": 88,
"method": null,
"native": false
},
{
"column": 17,
"file": "Object].emit (events.js",
"function": "[object",
"line": 67,
"method": null,
"native": false
},
{
"column": 12,
"file": "fs.js",
"function": "Object.oncomplete",
"line": 1058,
"method": "oncomplete",
"native": false
}
],
"stack": [
"ReferenceError: forever is not defined",
" at /Users/mikl/Work/Node/ardon/node_modules/forever/lib/forever/plugins/watch.js:34:7",
" at [object Object]. (fs.js:88:5)",
" at [object Object].emit (events.js:67:17)",
" at Object.oncomplete (fs.js:1058:12)"
],
"level": "error",
"message": "uncaughtException"
}

The “Ardon” code is available at https://github.com/revealit/ardon if you want to have a look, but it's so far a fairly simple attempt to do stuff with Flatiron.