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);