Node.js spawn child process best practice

I need to spawn a mocha process. It can be installed either locally, or globally, I don't know in advance.

This works only if mocha is installed globally:

require("child_process").spawn("mocha", argv._, {
    stdio: 'inherit'
});

Is there a way to spawn the process so it will work in both cases?