How can debug nodejs application using Atom installed in Debian


#1

I just installed Atom in my Debian (linux) workstation. I tried:

  1. node-debug via console I installed via:

demetrio@nodejs ~/Servers/Logs/logstash-5.2.2/bin apm install node-debug Installing node-debug to /home/demetrio/.atom/packages ✓ demetrio@nodejs ~/Servers/Logs/logstash-5.2.2/bin node-debug -v
Node Inspector v0.12.8
demetrio@nodejs ~/Servers/Logs/logstash-5.2.2/bin $ atom

then I tried “ctrl+I” and Packages>>Node Debug>>Run (same as crtl+I) and nothing happens.

  1. atom-node-debugger I tried:

demetrio@nodejs ~/Servers/Logs/logstash-5.2.2/bin apm install atom-node-debugger Installing atom-node-debugger to /home/demetrio/.atom/packages ✓ demetrio@nodejs ~/Servers/Logs/logstash-5.2.2/bin atom-node-debugger -v
atom-node-debugger: command not found
demetrio@nodejs ~/Servers/Logs/logstash-5.2.2/bin atom demetrio@nodejs ~/Servers/Logs/logstash-5.2.2/bin

then, I clicked Packages>>Node-debugger-start (same as F5) and I got this error:

[Enter steps to reproduce:]

Atom: 1.15.0 x64
Electron: 1.3.13
OS: Linux Mint
Thrown From: atom-node-debugger package 2.1.2

Stack Trace

Uncaught TypeError: this.processManager.startActiveFile is not a function

At /home/demetrio/.atom/packages/atom-node-debugger/lib/debugger.coffee:292

TypeError: this.processManager.startActiveFile is not a function
    at Debugger.start (/packages/atom-node-debugger/lib/debugger.coffee:292:25)
    at Debugger.start (/packages/atom-node-debugger/lib/debugger.coffee:1:1)
    at /packages/atom-node-debugger/lib/node-debugger.coffee:51:23)
    at CommandRegistry.module.exports.CommandRegistry.handleCommandEvent (/app.asar/src/command-registry.js:259:29)
    at CommandRegistry.handleCommandEvent (/app.asar/src/command-registry.js:3:59)
    at CommandRegistry.module.exports.CommandRegistry.dispatch (/app.asar/src/command-registry.js:160:19)
    at AtomEnvironment.module.exports.AtomEnvironment.dispatchApplicationMenuCommand (/app.asar/src/atom-environment.js:1162:28)
    at EventEmitter.outerCallback (/app.asar/src/application-delegate.js:312:25)
    at emitThree (events.js:116:13)
    at EventEmitter.emit (events.js:194:7)

Commands

     -0:05.6.0 node-debugger:start-resume (div.panels-item)

Non-Core Packages

atom-bugs 0.24.0 
atom-node-debugger 2.1.2 
atom-shell-commands 1.5.0 
node-debug 0.1.7 
script 3.14.1 
  1. script I tried:

demetrio@nodejs ~/Servers/Logs/logstash-5.2.2/bin apm install script Installing script to /home/demetrio/.atom/packages ✓ demetrio@nodejs ~/Servers/Logs/logstash-5.2.2/bin script -V
script from util-linux 2.27.1
demetrio@nodejs ~/Servers/Logs/logstash-5.2.2/bin $ atom

Then, by Packages>>Script>>Run Script (ctrl+shift+B) I can successfully run my serve.js (see bellow it) but (3.1) I can’t set a breakpoint (or I don’t know how).

  1. atom-runner

demetrio@nodejs ~/Servers/Logs/logstash-5.2.2/bin apm install atom-runner Installing atom-runner to /home/demetrio/.atom/packages ✓ demetrio@nodejs ~/Servers/Logs/logstash-5.2.2/bin atom-runner -v
atom-runner: command not found
demetrio@nodejs ~/Servers/Logs/logstash-5.2.2/bin $ atom

Very similar point to Script (Ctrl+R): I do start my node server but I can’t set (or I don’t know how) a breakpoint.

  1. atom-bugs

The closest I got to a traditional debbug (I mean set a breakpoint a follow from that point line-by-line). Nevertheless, I can’t stop effectvely the server. I click in red buttom and I am still getting the server up and running. If I try re-start I get:

Error: listen EADDRINUSE 127.0.0.1:5858
at Object.exports._errnoException (util.js:1034:11)
at exports._exceptionWithHostPort (util.js:1057:20)
at Agent.Server._listen2 (net.js:1270:14)
at listen (net.js:1306:10)
at doListening (net.js:1421:7)
at _combinedTickCallback (internal/process/next_tick.js:83:11)
at process._tickCallback (internal/process/next_tick.js:104:9)

I can see it is a very good IDE but I am bit stuck on how to establish a common/tradional way to debug. Any suggestion will be appreciated.

PS. this question was orinally published in http://stackoverflow.com/questions/43053953/how-can-debug-nodejs-application-using-atom-installed-in-debian