node-libnmap icon indicating copy to clipboard operation
node-libnmap copied to clipboard

Error: Error: spawn nmap ENOENT

Open Lk2v opened this issue 4 years ago • 2 comments

I'm trying to get all the devices connected on the network but I'm having this error.

Trace: Error: Error: spawn nmap ENOENT
    at process.<anonymous> (D:\Projet\@DeviceHub\node_modules\libnmap\lib\libnmap.js:116:17)
    at process.emit (events.js:223:5)
    at process._fatalException (internal/process/execution.js:150:25)
    at process.<anonymous> (D:\Projet\@DeviceHub\node_modules\libnmap\lib\libnmap.js:116:11)
    at process.emit (events.js:223:5)
    at process._fatalException (internal/process/execution.js:150:25)

Main.js

var opts = {
    range : [
        "***.***.*.0",
        "***.***.*.225",
    ],
}   

nmap.scan(opts, function(err, report) {
   
    for (let item in report) {
      console.log(JSON.stringify(report[item]));
    }
});

Lk2v avatar Jun 01 '20 09:06 Lk2v

Me too.. same error..

Rickyc81 avatar Jun 01 '20 10:06 Rickyc81

If you haven't set the nmap binary path, you need to set the environment variable in windows.

StuboUK avatar Mar 05 '21 17:03 StuboUK