mirror of
https://github.com/ershisan99/go-npm.git
synced 2025-12-16 20:59:28 +00:00
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:
@@ -45,6 +45,7 @@ function getInstallationPath(callback) {
|
||||
dir = stdout.trim();
|
||||
}
|
||||
|
||||
mkdirp.sync(dir);
|
||||
|
||||
callback(null, dir);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user