harryhorton/node-nmap

TypeError: Cannot set property 'pause' of undefined

jeancarlos1111 opened this issue · 14 comments

/home/jean/app_node/hostname_nmap/node_modules/queued-up/index.js:23
this.action.prototype.pause = this.pause;
^

TypeError: Cannot set property 'pause' of undefined
at new Queue (/home/jean/app_node/hostname_nmap/node_modules/queued-up/index.js:23:37)
at QueuedScan (/home/jean/app_node/hostname_nmap/node_modules/node-nmap/index.js:260:19)
at QueuedOsAndPortScan (/home/jean/app_node/hostname_nmap/node_modules/node-nmap/index.js:433:5)
at Object. (/home/jean/app_node/hostname_nmap/index.js:14:12)
at Module._compile (module.js:571:32)
at Object.Module._extensions..js (module.js:580:10)
at Module.load (module.js:488:32)
at tryModuleLoad (module.js:447:12)
at Function.Module._load (module.js:439:3)
at Module.runMain (module.js:605:10)
captura de pantalla de 2017-06-21 20-48-15

@jeancarlos1111 I'll look into this. Thanks for the bug report.

I got this one too.

Same error here - nmap 7.40 / macOS Sierra

Same here nmap 7.60 / gentoo Linux... Wild guess: Could it be, that the call fails, because newer nmaps require root-priviledges for os-names and mac-addresses?

it's related to : Johnhhorton/queued-up#5

-    this._queue = new Queue((host) => {
+    this._queue = new Queue(function (host) {

job-so@722590c#diff-168726dbe96b3ce427e7fedce31bb0bc

@job-so I try to run a queued scan with your revise and got error as follow:

/Users/raphaelsoul/hacker/node_modules/node-nmap/index.js:304
        this._queue.done();
                    ^

TypeError: this._queue.done is not a function
    at OsAndPortScan.currentScan.on (/Users/raphaelsoul/hacker/node_modules/node-nmap/index.js:304:21)
    at emitOne (events.js:115:13)
    at OsAndPortScan.emit (events.js:210:7)
    at ChildProcess.child.on (/Users/raphaelsoul/hacker/node_modules/node-nmap/index.js:194:14)
    at emitTwo (events.js:125:13)
    at ChildProcess.emit (events.js:213:7)
    at maybeClose (internal/child_process.js:927:16)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)

Hi @raphaelsoul

Did you use this patch : job-so@722590c#diff-168726dbe96b3ce427e7fedce31bb0bc
or
this one : https://github.com/Johnhhorton/queued-up/pull/6

or a combination of both ?

Is there any fork of your code I may look at ?

Thanks.

Olivier.

I am also getting the TypeError: this._queue.done is not a function when applying your change to job-so@722590c#diff-168726dbe96b3ce427e7fedce31bb0bc

Any tips on what else you might need to change?

Hi @PierrickI3 , which version of node.js are you using ?
This patch is working well on v8.7.0

Hey @job-so, v8.9.1

OK my fault ... :-(
Please try this :

  • Revert to original node-nmap module : this._queue = new Queue((host) => {
  • and patch the queued-up module like in this PR : Johnhhorton/queued-up/pull/6 based on this job-so/queued-up

Let me know if it helps
Olivier.

That worked. Thanks @job-so !