4 var p = require(__dirname + '../../package.json');
5 var dep = process.argv[2];
6 var npm = require("/usr/local/lib/node_modules/npm");
7 var path = require('path');
8 var version = p.dependencies[dep];
9 if (!version) throw new Error('Unknown dependency:' + dep);
11 if (version.indexOf('file:') === 0) {
12 var location = version.substring(5);
13 var j = path.normalize(path.join(__dirname, '../', location));
14 var relLocation = path.relative(process.cwd(), j);
15 version = 'file:' + relLocation;
24 npm.commands.install([dep + "@" + version], function (err) {
28 npm.on("log", function (message) {
29 // log the progress of the installation