Debugging node apps using node-inspector is pretty simple if you're scripting using JavaScript or compiled Coffee (coffee -c -m script.coffee
).
However, when using the coffeescript require
handler:
require('coffee-script/register');
require('lib/component.coffee');
in a script I'm trying to debug using node-debug
, I get:
(function (exports, require, module, __filename, __dirname) { #
^
SyntaxError: Unexpected token ILLEGAL
at Module._compile (module.js:439:25)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Module.require (module.js:364:17)
at require (module.js:380:17)
...
right as I require
the file.
Is what I'm trying to do possible? I have several CoffeeScript files that I would much rather not have to compile each time I want to test.