jbt / docker

Documentation generator
http://jbt.github.com/docker
MIT License
233 stars 56 forks source link

Nodejs 0.10 events.js exception #30

Closed 0x80 closed 11 years ago

0x80 commented 11 years ago

I'm just trying out docker for the first time, but I keep getting this exception no matter what I try. I just upgraded to node 0.10, maybe it's not compatible?

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

jbt commented 11 years ago

Do you have Pygments installed? That's one possible cause of that error - check out http://pygments.org/download/ if not.

In other news, I am planning to drop the pygments dependency very soon, as soon as I can find the time.

0x80 commented 11 years ago

Ah it's working now. Maybe you could add a check in your code to detect it and give an informative error message. In a project I'm using this:

function findExecutable(name, callback) {
var exec = require('child_process').exec;
exec("which " + name, function (error, stdout) {
    // strip newline (todo also whitespace?)
    var path = stdout.replace("\n", '');
    if (path === "") {
        callback(new Error("No executable found with name: " + name));
    } else {
        callback(null, path);
    }
});
}
jbt commented 11 years ago

Yeah that'd be a good idea. I think I put something in the npm install script, but yeah probably should have something in the actual runner too.

jbt commented 11 years ago

I'm going to close this as I've already got #31 open for dropping the pygments dependency ASAP.

Doing a "which pygmentize" probably wouldn't be suitable as a sanity check because it wouldn't work on windows machines. I think for now I'm just going to leave it and hopefully rip out the pygments dependency altogether very soon.

0x80 commented 11 years ago

Hi jbt. I just recently discovered shelljs. This is a portable posix shell interface for node. It has a "which" method that should work on Windows too as I understand it. But it adds a dependency of course...