-
Notifications
You must be signed in to change notification settings - Fork 2.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pm2 not working with esm on windows 10, there are no workarounds! #4819
Comments
Is this by design? Can it not be fixed? |
Would be nice if this got addressed... |
Workaround: go to to the pm2 package file with the single failure and hardcode the path to your script, without a drive letter, instead of the variable it's using. It's choking on the "C:" path it's getting. |
Hi @rujiel Please where is this package file located |
In this file C:\Program Files\nodejs\node_modules\pm2\lib\ProcessContainer.js line 301 needs a path (with no drive letter) rather than the variable it's getting:
|
i found a fix at node_modules\pm2\lib\ProcessContainer.js line 301 replace it with the following code with this below import(require('url').pathToFileURL(process.env.pm_exec_path)); hope it help |
Nice, can you do a pull request please? |
I was going to until I found out someone already done it |
oh, killer. thank you! |
The PR was closed with no indication as to why... |
It helps me a lot! :) |
Is this issue solved in the latest versions of pm2? |
Yes, it is
…On Mon, Oct 10, 2022, 9:01 AM Riyazur Razak N ***@***.***> wrote:
Is this issue solved in the latest versions of pm2?
—
Reply to this email directly, view it on GitHub
<#4819 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABF2LHUWB5X2TPNBG7WBA43WCQ4VDANCNFSM4QDZVMZQ>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Well looks like this issue is still not solved so have to fix on the global installation. |
This has been solved in #5524 |
What's going wrong?
#4688
Issue is closud but not solved, now it is not possible to use pm2 on windows 10 with esm modules.
How could we reproduce this issue?
Try to run nodejs script in esm module format
Supporting information
--- PM2 report ----------------------------------------------------------------
Date : Tue Aug 18 2020 20:14:39 GMT+0300 (Москва, стандартное время)
--- Daemon -------------------------------------------------
pm2d version : 4.4.1
node version : 14.8.0
node path : not found
argv : D:\Program Files\nodejs\node.exe,C:\Users\Forux\AppData\Roaming\npm\node_modules\pm2\lib\Daemon.js
argv0 : node
user : undefined
uid : N/A
gid : N/A
uptime : 55min
--- CLI ----------------------------------------------------
local pm2 : 4.4.1
node version : 14.8.0
node path : not found
argv : D:\Program Files\nodejs\node.exe,C:\Users\Forux\AppData\Roaming\npm\node_modules\pm2\bin\pm2,report
argv0 : D:\Program Files\nodejs\node.exe
user : Forux
--- System info --------------------------------------------
arch : x64
platform : win32
type : Windows_NT
cpus : Intel(R) Core(TM) i7-7700HQ CPU @ 2.80GHz
cpus nb : 8
freemem : 19485593600
totalmem : 34235043840
home : C:\Users\Forux
--- PM2 list -----------------------------------------------
┌─────┬───────────┬─────────────┬─────────┬─────────┬──────────┬────────┬──────┬───────────┬──────────┬──────────┬──────────┬──────────┐
│ id │ name │ namespace │ version │ mode │ pid │ uptime │ ↺ │ status │ cpu │ mem │ user │ watching │
└─────┴───────────┴─────────────┴─────────┴─────────┴──────────┴────────┴──────┴───────────┴──────────┴──────────┴──────────┴──────────┘
--- Daemon logs --------------------------------------------
C:\Users\Forux.pm2\pm2.log last 20 lines:
PM2 | 2020-08-18T20:02:48: PM2 log: pid=14132 msg=process killed
PM2 | 2020-08-18T20:02:48: PM2 log: App [uploadModels:0] starting in -fork mode-
PM2 | 2020-08-18T20:02:48: PM2 log: App [uploadModels:0] online
PM2 | 2020-08-18T20:02:53: PM2 log: [Watch] Stop watching uploadModels
PM2 | 2020-08-18T20:02:53: PM2 log: Stopping app:uploadModels id:0
PM2 | 2020-08-18T20:02:53: PM2 log: App [uploadModels:0] exited with code [1] via signal [SIGINT]
PM2 | 2020-08-18T20:02:53: PM2 log: pid=17164 msg=process killed
PM2 | 2020-08-18T20:02:54: PM2 log: [Watch] Start watching uploadModels
PM2 | 2020-08-18T20:02:54: PM2 log: App [uploadModels:0] starting in -fork mode-
PM2 | 2020-08-18T20:02:54: PM2 log: App [uploadModels:0] online
PM2 | 2020-08-18T20:04:31: PM2 log: Change detected on path server.log for app uploadModels - restarting
PM2 | 2020-08-18T20:04:31: PM2 log: Stopping app:uploadModels id:0
PM2 | 2020-08-18T20:04:31: PM2 log: App [uploadModels:0] exited with code [1] via signal [SIGINT]
PM2 | 2020-08-18T20:04:31: PM2 log: pid=22556 msg=process killed
PM2 | 2020-08-18T20:04:31: PM2 log: App [uploadModels:0] starting in -fork mode-
PM2 | 2020-08-18T20:04:31: PM2 log: App [uploadModels:0] online
PM2 | 2020-08-18T20:04:36: PM2 log: [Watch] Stop watching uploadModels
PM2 | 2020-08-18T20:04:36: PM2 log: Stopping app:uploadModels id:0
PM2 | 2020-08-18T20:04:37: PM2 log: App [uploadModels:0] exited with code [1] via signal [SIGINT]
PM2 | 2020-08-18T20:04:37: PM2 log: pid=12156 msg=process killed
The text was updated successfully, but these errors were encountered: