1

GeddyJS is started by running geddy from the root of the project.

I'm having some trouble getting GeddyJS to run under node.js with debug enabled.

getty installs /usr/local/bin/geddy:

#!/usr/bin/env node
...

which I made a quick copy of, and amended the shebang line:

#!/usr/bin/env node --debug
...

but that does not work, because env can't find 'node --debug'.

I then tried to write a wrapper script to act as the interpreter in the shebang line here:

#!/bin/sh
exec /usr/bin/env node --debug $@

And this time, node is started with a debugger enabled, but the paths must be messed up, or environment must be different, because I am getting missing module exceptions:

$ geddy-debug
debugger listening on port 5858

node.js:201
        throw e; // process.nextTick error, or 'error' event on first tick
              ^
Error: Cannot find module '../lib/geddy'
    at Function._resolveFilename (module.js:332:11)
    at Function._load (module.js:279:25)
    at Module.require (module.js:354:17)
    at require (module.js:370:17)
    at Object. (/usr/local/bin/geddy-debug:4:1)
    at Module._compile (module.js:441:26)
    at Object..js (module.js:459:10)
    at Module.load (module.js:348:31)
    at Function._load (module.js:308:12)
    at Array.0 (module.js:479:10)

This of course works fine if I don't try to enable debugging.

I want to debug in eclipse as per : https://github.com/joyent/node/wiki/Using-Eclipse-as-Node-Applications-Debugger, which works great with just node --debug scriptname.js

Any suggestions are appreciated.

dwerner
  • 6,462
  • 4
  • 30
  • 44

2 Answers2

3

Answering my own question, so others can benefit if they happen to see this:

From the project directory, override the shebang line and invoke the interpreter directly to run the geddy script:

/usr/bin/env node --debug /usr/local/bin/geddy

dwerner
  • 6,462
  • 4
  • 30
  • 44
  • How did this turn out for you? I'm trying to debug a geddy app as well when I found this: http://stackoverflow.com/questions/9587655/no-breakpoints-are-hit-with-geddy I'm not able to set/hit any breakpoints. Were you? – prodaea Sep 28 '12 at 16:54
  • 1
    I ended up ditching geddy. I found a better path through express.js to build my app at the time. – dwerner Sep 28 '12 at 20:03
  • I came to the same conclusion. I'm using express now and I'm looking to move on to flatiron possibly. – prodaea Oct 11 '12 at 20:27
0

There's a Debugging Geddy WikiPage with a bit more info.

Miguel Madero
  • 1,948
  • 13
  • 21