Fix PM2 ENOENT error on Windows by using full path to binary (#60)

* Initial plan

* Initial plan for fixing PM2 path issue on Windows

Co-authored-by: thedotmack <683968+thedotmack@users.noreply.github.com>

* Fix PM2 ENOENT error on Windows by using full path to PM2 binary

Co-authored-by: thedotmack <683968+thedotmack@users.noreply.github.com>

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: thedotmack <683968+thedotmack@users.noreply.github.com>
This commit is contained in:
Copilot
2025-11-06 12:06:45 -05:00
committed by GitHub
parent 22f4655a8c
commit 6a4fa85c10
2 changed files with 5 additions and 8 deletions
+3 -2
View File
@@ -211,13 +211,14 @@ function runNpmInstall() {
function startWorker() {
const ECOSYSTEM_CONFIG = join(PLUGIN_ROOT, 'ecosystem.config.cjs');
const PM2_PATH = join(PLUGIN_ROOT, 'node_modules', '.bin', 'pm2');
log('🚀 Starting worker service...', colors.dim);
try {
// Use pm2 start which works whether worker is running or not
// Use the full path to PM2 to avoid PATH issues on Windows
// PM2 will either start it or report it's already running (both are success cases)
execSync(`pm2 start "${ECOSYSTEM_CONFIG}"`, {
execSync(`"${PM2_PATH}" start "${ECOSYSTEM_CONFIG}"`, {
cwd: PLUGIN_ROOT,
stdio: 'pipe', // Capture output to avoid clutter
encoding: 'utf-8',