harryhorton / node-nmap

NPM package for interfacing with local NMAP installation
MIT License
67 stars 26 forks source link

TypeError: Cannot set property 'pause' of undefined #26

Open jeancarlos1111 opened 7 years ago

jeancarlos1111 commented 7 years ago

/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

harryhorton commented 7 years ago

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

mainstreetmark commented 7 years ago

I got this one too.

dunklesToast commented 7 years ago

Same error here - nmap 7.40 / macOS Sierra

openWebX commented 6 years ago

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?

job-so commented 6 years ago

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

job-so commented 6 years ago
-    this._queue = new Queue((host) => {
+    this._queue = new Queue(function (host) {

https://github.com/job-so/node-nmap/commit/722590cd8e5c9c7278e5c6510595fa8928acf848#diff-168726dbe96b3ce427e7fedce31bb0bc

raphaelsoul commented 6 years ago

@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)
job-so commented 6 years ago

Hi @raphaelsoul

Did you use this patch : https://github.com/job-so/node-nmap/commit/722590cd8e5c9c7278e5c6510595fa8928acf848#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.

PierrickLozach commented 6 years ago

I am also getting the TypeError: this._queue.done is not a function when applying your change to https://github.com/job-so/node-nmap/commit/722590cd8e5c9c7278e5c6510595fa8928acf848#diff-168726dbe96b3ce427e7fedce31bb0bc

Any tips on what else you might need to change?

job-so commented 6 years ago

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

PierrickLozach commented 6 years ago

Hey @job-so, v8.9.1

job-so commented 6 years ago

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

Let me know if it helps Olivier.

PierrickLozach commented 6 years ago

That worked. Thanks @job-so !

harryhorton commented 6 years ago

36