var exec = require('child_process').exec;

var path = require('path');

module.exports = installModule;

/* given a location of node_modules it will try and install the
    named dep into that location.

    Assumes npm.load() was called

*/
function installModule(nodeModules, dep, opts, cb) {
    var where = path.join(nodeModules, '..');

    console.log('installing ', where, dep.resolved);

    exec('npm install ' + dep.resolved, {
        cwd: where
    }, cb);
}

@@ -392,18 +392,22 @@
 d);%0A
-%0A
     
-exec(
+var cmd = 
 'npm
@@ -431,16 +431,110 @@
 resolved
+;%0A%0A    if (opts.registry) %7B%0A        cmd += ' --registry=' + opts.registry;%0A    %7D%0A%0A    exec(cmd
 , %7B%0A    

support a hard coded registry