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.
This commit is contained in:
Jan Molak
2017-09-27 13:30:21 +01:00
committed by GitHub
parent 70405520b3
commit 1b0d186011

View File

@@ -45,6 +45,7 @@ function getInstallationPath(callback) {
dir = stdout.trim();
}
mkdirp.sync(dir);
callback(null, dir);
});