Saturday, January 10, 2015

NodeFuzz: nodejs "Error: spawn ENOENT" error

ENOENT error is due to the unavailability of required command in the PATH environment variable directories.

root@darshanams:~/Downloads/NodeFuzz-0.1.1# nodejs nodefuzz.js
Loading linux-configuration.
No module folder given. Defaulting to ./modules/ from config.js
Found property init() from module ./modules//DemoCanvasModule.js
You could have some inits in DemoCanvasModule.js and it would be executed now.
Successfully required module DemoCanvasModule.js
Found property init() from module ./modules//DemoMinModule.js
Successfully required module DemoMinModule.js
Will not handle directories in module-dir. Skipping ./modules//Helpers
We have 2 modules available.
Server listening port 8080

events.js:72
        throw er; // Unhandled 'error' event
              ^
Error: spawn ENOENT
    at errnoException (child_process.js:1000:11)
    at Process.ChildProcess._handle.onexit (child_process.js:791:34)


Search for spawn or child_process.spawn in our NodeFuzz or Applications source code which should be of the form
    spawn(command, args)
in my case it was
        browser = spawn(config.launch_command, config.browser_args)

Add below lines on top of spawn
    console.log( process.env.PATH );
    console.log( config.launch_command );
which prints PATH environment variable values and command being used.
This is the output on my console
    /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
   google-chrome


So the issue is with command "google-chrome", node is unable to find or execute the command. Instead of throwing the exception to stdout lets handle the exception.
     browser = spawn(config.launch_command, config.browser_args)
   browser.on('error', function (err) {
        console.log('config.launch_command error', err);

   });

I am not a Java programmer, stuck with this error for 2 days. Googling also showns that this is a frequent error without a solution.

To fix similar issues read
http://stackoverflow.com/questions/27688804/how-do-i-debug-error-spawn-enoent-on-node-js

Hope, this helps someone somehwhere :-)

3 comments:

  1. You can deposit with bank cards as well as|in addition to} Bitcoin, Litecoin, Bitcoin Cash, Ethereum, Ripple, Dogecoin, Cardano, Binance Coin, Tron, and Tether. Currently, 1xbet korea their homepage contains a card saying over four,200 titles, with 12 model new, so you know they’re including extra a daily basis}. This makes them a perfect choice for gamblers who love exploring various slot machines. Their on-line table sport choice can also be|can be} pretty first rate, with everything from Casino Solitaire to Caribbean and Pai Gow poker. You’ll additionally find quite a number of} varieties of single-hand, multi-hand, and multi-deck blackjack, including a couple of other fascinating variations like Pirate 21 and 21 Burn. All deposit bonuses are subject to 35x wagering requirements and should be performed through earlier than making the following deposit.

    ReplyDelete