Skip to content

Commit

Permalink
Update ProcessContainer.js
Browse files Browse the repository at this point in the history
  • Loading branch information
BlueWater86 authored Jan 16, 2023
1 parent 5dbb561 commit ca36f30
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/ProcessContainer.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);

Expand Down

0 comments on commit ca36f30

Please sign in to comment.