From ca36f3019b43fab014f4823435a9b207228f9482 Mon Sep 17 00:00:00 2001 From: BlueWater86 Date: Mon, 16 Jan 2023 14:04:04 +1000 Subject: [PATCH] Update ProcessContainer.js --- lib/ProcessContainer.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/ProcessContainer.js b/lib/ProcessContainer.js index 158391d32..616a7ac21 100644 --- a/lib/ProcessContainer.js +++ b/lib/ProcessContainer.js @@ -13,6 +13,7 @@ var p = require('path'); var cst = require('../constants'); var Utility = require('./Utility.js'); var ProcessUtils = require('./ProcessUtils'); +var Url = require('url'); // Load all env-vars from master. var pm2_env = JSON.parse(process.env.pm2_env); @@ -298,7 +299,7 @@ function exec(script, stds) { process.chdir(pm2_env.pm_cwd || process.env.PWD || p.dirname(script)); if (ProcessUtils.isESModule(script) === true) - import(process.env.pm_exec_path); + import(Url.pathToFileURL(process.env.pm_exec_path)); else require('module')._load(script, null, true);