diff --git a/bin.js b/bin.js index 19e561a33..6a4102cf5 100755 --- a/bin.js +++ b/bin.js @@ -1,13 +1,14 @@ #!/usr/bin/env node -var program = require('commander'), - color = require('colorful'), - fs = require("fs"), - path = require("path"), - npm = require("npm"), - packageInfo = require("./package.json"), - util = require("./lib/util"), - logUtil = require("./lib/log"); +var program = require('commander'), + color = require('colorful'), + fs = require("fs"), + path = require("path"), + globalModules = require("global-modules"), + npm = require(path.join(globalModules, "npm")), + packageInfo = require("./package.json"), + util = require("./lib/util"), + logUtil = require("./lib/log"); program .version(packageInfo.version) diff --git a/package.json b/package.json index cad28d188..45f810539 100644 --- a/package.json +++ b/package.json @@ -15,6 +15,7 @@ "commander": "~2.3.0", "compression": "^1.4.4", "express": "^4.8.5", + "global-modules": "^1.0.0", "iconv-lite": "^0.4.6", "ip": "^0.3.2", "juicer": "^0.6.6-stable", @@ -22,7 +23,6 @@ "nedb": "^0.11.0", "node-easy-cert": "^1.0.0", "node-forge": "^0.6.39", - "npm": "^2.7.0", "promise": "^7.0.4", "qrcode-npm": "0.0.3", "stream-throttle": "^0.1.3",