From 1b0d1860116d6d47249a86fd05f9e981530a69a1 Mon Sep 17 00:00:00 2001 From: Jan Molak Date: Wed, 27 Sep 2017 13:30:21 +0100 Subject: [PATCH] Ensure the installation path exists When a `go-npm`-enabled module is installed, `go-npm` will pick a destination directory for said module's binary based on the output of `npm bin`. However, if there's no `node_modules` sub-directory present (which is the case when `npm` hoists the dependencies of such module up), the installation directory suggested by `npm bin` doesn't exist and the installation fails. This fix ensures that the installation directory exists. --- src/index.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/index.js b/src/index.js index d69394a..c342ce3 100644 --- a/src/index.js +++ b/src/index.js @@ -45,6 +45,7 @@ function getInstallationPath(callback) { dir = stdout.trim(); } + mkdirp.sync(dir); callback(null, dir); });