From 0b8bc19bddab17ffe8e8bb051f201888351eced0 Mon Sep 17 00:00:00 2001 From: Eddy Hyunchul Kim Date: Tue, 31 Dec 2019 13:17:11 +0900 Subject: [PATCH] Fix an error for pm2 path on Windows. https://github.com/Unitech/pm2/issues/3793 --- lib/Daemon.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/Daemon.js b/lib/Daemon.js index 7fb9817a0..17e18d6b7 100644 --- a/lib/Daemon.js +++ b/lib/Daemon.js @@ -45,7 +45,7 @@ Daemon.prototype.start = function() { console.error('[PM2] Resurrecting PM2'); - var path = cst.IS_WINDOWS ? process.cwd() + '/bin/pm2' : process.env['_']; + var path = cst.IS_WINDOWS ? __dirname + '/../bin/pm2' : process.env['_']; var fork_new_pm2 = require('child_process').spawn('node', [path, 'update'], { detached: true, stdio: 'inherit'