diff --git a/cli/pbts.js b/cli/pbts.js index 41c0fc0aa..66bac6c46 100644 --- a/cli/pbts.js +++ b/cli/pbts.js @@ -97,7 +97,7 @@ exports.main = function(args, callback) { // There is no proper API for jsdoc, so this executes the CLI and pipes the output var basedir = path.join(__dirname, ".."); var moduleName = argv.name || "null"; - var cmd = "node \"" + basedir + "/node_modules/jsdoc/jsdoc.js\" -c \"" + basedir + "/jsdoc.types.json\" -q \"module=" + encodeURIComponent(moduleName) + "&comments=" + Boolean(argv.comments) + "\" " + files.map(function(file) { return '"' + file + '"'; }).join(' '); + var cmd = "node \"" + require.resolve("jsdoc/jsdoc.js") + "\" -c \"" + path.join(basedir, "jsdoc.types.json") + "\" -q \"module=" + encodeURIComponent(moduleName) + "&comments=" + Boolean(argv.comments) + "\" " + files.map(function(file) { return "\"" + file + "\""; }).join(" "); var child = child_process.exec(cmd, { cwd: process.cwd(), argv0: "node",