You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
when trying to debug a simple sample script in learnyounode, the learnyounode.js can be stepped through, but the sample script cannot be. according to the discussion below, this is a bug in learnyounode.
create sample script:-
var a = '2';
var b = '3';
debugger;
console.log(a + b);
save as debugme.js
launch debug from terminal
node --debug-brk /usr/local/lib/node_modules/learnyounode/learnyounode.js run debugme.js
hit debug button in eclipse
expected :- breakpoint is hit on the debugger; statement
actual :- can step through code in learnyounode.js, but then the debug session terminates before going in to the debugme.js but the output is printed to the terminal (not the console)
please fix as this will help with trickier scripts to figure out what is going on when they are running!
does anyone know how to debug learnyounode modules with nodeclipse?
dave00galloway an hour ago
if I start debugging using node --debug-brk program.js then I can step through the code, but because the script wasn't launched by learnyounode, the arguments aren't passed to the process.argv[] array
i followed https://github.com/joyent/node/wiki/using-eclipse-as-node-applications-debugger and http://www.nodeclipse.org/usage and http://sourceforge.net/projects/nodeclipse/files/Enide-Studio-2014/0.11-preview/Enide-Studio-2014-011-20140228-macosx-cocoa-x86_64.zip/download to get this far
martinheidegger an hour ago
learnyounode is only just a nodejs script 😄
This message was deleted
dave00galloway 35 minutes ago
thanks for the reply .. so... how do i debug it? how do I pass the script that I want to debug (program.js) to learnyounode with the debug-brk argument?
martinheidegger 31 minutes ago
(bash syntax)
npm root -g … will give you the path where global modules are stored
$(npm root -g)/learnyounode …… is the folder for the learnyounode code
node --debug /usr/local/lib/node_modules/learnyounode/learnyounode.js …. runs learnyounode in debug mode
node --debug /usr/local/lib/node_modules/learnyounode/learnyounode.js run 01.js … runs the 01.js script in debug mode
dave00galloway 22 minutes ago
thanks again - getting closer but not quite there. the steps you describe take me into the learnyounode.js file and allow me to step through it. pretty cool, but at no point do I hit the breakpoint in program.js that I set just after variable declarations.
martinheidegger 22 minutes ago
add a “debugger” statement?
dave00galloway 22 minutes ago
the script program.js IS called, because after the debugger exits, the output from program.js is output to the terminal
martinheidegger 21 minutes ago
how did you add the breakpoint?
dave00galloway 21 minutes ago
double clicked in margin in eclipse, sorry, nodeclipse
martinheidegger 21 minutes ago
just write in your code: debugger;
like
var a = “2”;
var b = “3”;
debugger;
console.log(a + b);
dave00galloway 16 minutes ago
same thing happens, step through the learnyounode.js file, but doesn't hit the breakpoint at the debugger; statement
martinheidegger 16 minutes ago
😔
.oO( ….? …. )
dave00galloway 16 minutes ago
here's the output
davids-MacBook-Pro:LearnYouNode dave$ node --debug-brk /usr/local/lib/node_modules/learnyounode/learnyounode.js run debugme.js
debugger listening on port 5858
23
davids-MacBook-Pro:LearnYouNode dave$ node /usr/local/lib/node_modules/learnyounode/learnyounode.js run debugme.js
23
so, the simple script you provided does get called, but I can only step through the learnyounode code, not the debugme.js code
any suggestions?
martinheidegger 9 minutes ago http://stackoverflow.com/questions/9507345/use-node-js-command-line-debugger-on-child-process#answer-18614851
Seems like learnyounode forgot to ensure this happens https://github.com/rvagg/workshopper-exercise/blob/master/execute.js#L80
i smell BUG or rather: ENHANCEMENT ...
Seems like someone has to write a pull-request ...
.oO( or at least an issue )
dave00galloway 3 minutes ago
The text was updated successfully, but these errors were encountered:
when trying to debug a simple sample script in learnyounode, the learnyounode.js can be stepped through, but the sample script cannot be. according to the discussion below, this is a bug in learnyounode.
steps to reproduce
https://github.com/joyent/node/wiki/using-eclipse-as-node-applications-debugger and http://www.nodeclipse.org/usage and http://sourceforge.net/projects/nodeclipse/files/Enide-Studio-2014/0.11-preview/Enide-Studio-2014-011-20140228-macosx-cocoa-x86_64.zip/download)
var a = '2';
var b = '3';
debugger;
console.log(a + b);
node --debug-brk /usr/local/lib/node_modules/learnyounode/learnyounode.js run debugme.js
expected :- breakpoint is hit on the debugger; statement
please fix as this will help with trickier scripts to figure out what is going on when they are running!
ref:- https://gitter.im/nodeschool/discussions
does anyone know how to debug learnyounode modules with nodeclipse?
dave00galloway an hour ago
if I start debugging using node --debug-brk program.js then I can step through the code, but because the script wasn't launched by learnyounode, the arguments aren't passed to the process.argv[] array
i followed https://github.com/joyent/node/wiki/using-eclipse-as-node-applications-debugger and http://www.nodeclipse.org/usage and http://sourceforge.net/projects/nodeclipse/files/Enide-Studio-2014/0.11-preview/Enide-Studio-2014-011-20140228-macosx-cocoa-x86_64.zip/download to get this far
martinheidegger an hour ago
learnyounode is only just a nodejs script 😄
This message was deleted
dave00galloway 35 minutes ago
thanks for the reply .. so... how do i debug it? how do I pass the script that I want to debug (program.js) to learnyounode with the debug-brk argument?
martinheidegger 31 minutes ago
(bash syntax)
npm root -g … will give you the path where global modules are stored
$(npm root -g)/learnyounode …… is the folder for the learnyounode code
node --debug /usr/local/lib/node_modules/learnyounode/learnyounode.js …. runs learnyounode in debug mode
node --debug /usr/local/lib/node_modules/learnyounode/learnyounode.js run 01.js … runs the 01.js script in debug mode
dave00galloway 22 minutes ago
thanks again - getting closer but not quite there. the steps you describe take me into the learnyounode.js file and allow me to step through it. pretty cool, but at no point do I hit the breakpoint in program.js that I set just after variable declarations.
martinheidegger 22 minutes ago
add a “debugger” statement?
dave00galloway 22 minutes ago
the script program.js IS called, because after the debugger exits, the output from program.js is output to the terminal
martinheidegger 21 minutes ago
how did you add the breakpoint?
dave00galloway 21 minutes ago
double clicked in margin in eclipse, sorry, nodeclipse
martinheidegger 21 minutes ago
just write in your code: debugger;
like
var a = “2”;
var b = “3”;
debugger;
console.log(a + b);
dave00galloway 16 minutes ago
same thing happens, step through the learnyounode.js file, but doesn't hit the breakpoint at the debugger; statement
martinheidegger 16 minutes ago
😔
.oO( ….? …. )
dave00galloway 16 minutes ago
here's the output
davids-MacBook-Pro:LearnYouNode dave$ node --debug-brk /usr/local/lib/node_modules/learnyounode/learnyounode.js run debugme.js
debugger listening on port 5858
23
davids-MacBook-Pro:LearnYouNode dave$ node /usr/local/lib/node_modules/learnyounode/learnyounode.js run debugme.js
23
so, the simple script you provided does get called, but I can only step through the learnyounode code, not the debugme.js code
any suggestions?
martinheidegger 9 minutes ago
http://stackoverflow.com/questions/9507345/use-node-js-command-line-debugger-on-child-process#answer-18614851
Seems like learnyounode forgot to ensure this happens https://github.com/rvagg/workshopper-exercise/blob/master/execute.js#L80
i smell BUG or rather: ENHANCEMENT ...
Seems like someone has to write a pull-request ...
.oO( or at least an issue )
dave00galloway 3 minutes ago
The text was updated successfully, but these errors were encountered: