fix: #3456 use homedir() instead of process.env.HOME, make module installation work on windows

This commit is contained in:
vince 2018-02-26 14:45:34 +01:00
parent 8479695634
commit 1e0017325f

View File

@ -6,6 +6,7 @@
var shelljs = require('shelljs');
var path = require('path');
var fs = require('fs');
var os = require('os');
var async = require('async');
var p = path;
var readline = require('readline');
@ -185,7 +186,7 @@ Modularizer.installModule = function(CLI, module_name, opts, cb) {
var install_path = path.join(cst.DEFAULT_MODULE_PATH, canonic_module_name);
mkdirp(install_path, function() {
process.chdir(process.env.HOME);
process.chdir(os.homedir());
var install_instance = spawn(cst.IS_WINDOWS ? 'npm.cmd' : 'npm', ['install', module_name, '--loglevel=error', '--prefix', install_path ], {
stdio : 'inherit',