본문 바로가기
IT&DEV - IT & 개발/Common

pm2-web window환경 설정

by Hoft 2017. 9. 27.
728x90
반응형

1. pm2 home 디렉토리 확인


c:User/UserName/AppData/Roaming/npm/node_modules/pm2/paths.js



    PM2_ROOT_PATH = p.resolve(process.env.HOMEDRIVE, process.env.HOME || process.env.HOMEPATH, '.pm2');



pm2-web .   config.json .  수정


// To monitor multiple hosts, add extra entries to this array

"pm2": [{

"host": "localhost",

"rpc": "~/.pm2/rpc.sock",

"events": "~/.pm2/pub.sock"


// To debug remote processes, run node-inspector on the remote host and add the port

// it's listnening on here:

//, inspector: 8080

}],




"rpc": "//./pipe/rpc.sock",

"events": "//./pipe/pub.sock",


변경.








Windows

getpwuid() is a POSIX function and won't work on Windows.

Use optionalDependencies if you need to include it in a cross-platform environment.


윈도우 미지원.  os = require("os");   사용

components 에 configuration.js 수정



// var userDetails = pwuid();

    console.log("###################");

//    console.log(userDetails);

    var newdir = os.homedir();

    console.log(os.homedir());

    console.log("###################");

// ensure data is correct for each host

args.forEach(function(host) {

host.host = host.host || "localhost";

host.rpc = host.rpc || "~/.pm2/rpc.sock";

host.events = host.events || "~/.pm2/pub.sock";


if(host.rpc.substring(0, 1) == "~") {

// host.rpc = userDetails.dir + host.rpc.substring(1)

host.rpc = newdir + host.rpc.substring(1)

}


if(host.events.substring(0, 1) == "~") {

// host.events = userDetails.dir + host.events.substring(1)

host.events = newdir + host.events.substring(1)




728x90
반응형

댓글