Nodejs cloud9 debugger and gulp - grunt - npm

nodejs

#1

How can I launch a node app using gulp - grunt - npm AND connect it to the debugger in cloud9?

In my case I am using the “child_process” to start the server.

Something like this:


Debugger in node.js react-starter-kit
How do I use cloud9's debugger when running a grunt task?
#2

you need to pass debugging options to the child_process when launching it similar to https://github.com/c9/c9.ide.run/blob/master/runners/Node.js.run

you can create a runner that launches grunt and change
cp.spawn('node', [serverPath], { to

cp.spawn('node', [
    "--nocrankshaft", 
    "--nolazy", 
    "--nodead_code_elimination",
    "--debug-brk=15454", 
    serverPath
], {
{
    "script": [
       // script to launch here
    ],
    "debugger": "v8",
    "debugport": 15454 // port needs to be the same as the one passed to --debug-brk
}