diff --git a/README.md b/README.md index 77e5f05..429c2de 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ Compile javascript **with** node.js. This allows you to move your executable aro Via NPM: ```bash - npm install nexe + npm install nexe [-g] ``` Or git: diff --git a/lib/index.js b/lib/index.js index cfd9e50..fbfbc9e 100644 --- a/lib/index.js +++ b/lib/index.js @@ -214,7 +214,7 @@ function monkeyPatchNodejs(node, next) { if(~content.indexOf('nexe')) return this(); fs.writeFile(nodejsPath, - content.replace(/\(function\(process\) \{/,'(function(process){ \n process._eval = \'require("nexe");\'; '), + content.replace(/\(function\(process\) \{/,'(function(process) {\n process._eval = \'require("nexe");\';\n process.argv.unshift("node");\n'), "utf8", this); }), diff --git a/package.json b/package.json index 471a7d2..05560d2 100644 --- a/package.json +++ b/package.json @@ -18,6 +18,7 @@ "mkdirp": "0.3.x", "sardines": "0.4.x" }, + "preferGlobal": "true", "bin": { "nexe": "./bin/nexe" },