mirror of
https://github.com/Unitech/pm2.git
synced 2025-12-08 20:35:53 +00:00
fix: #3456 use homedir() instead of process.env.HOME, make module installation work on windows
This commit is contained in:
parent
8479695634
commit
1e0017325f
@ -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',
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user