Skip to content
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 #4688

Closed
yinonby opened this issue Apr 28, 2020 · 4 comments
Closed

pm2 not working with ESM on windows #4688

yinonby opened this issue Apr 28, 2020 · 4 comments
Labels

Comments

@yinonby
Copy link

yinonby commented Apr 28, 2020

What's going wrong?

pm2 start api.js

8|api | Error [ERR_UNSUPPORTED_ESM_URL_SCHEME]: Only file and data URLs are supported by the default ESM loader
8|api | at Loader.defaultResolve [as _resolve] (internal/modules/esm/resolve.js:619:11)
8|api | at Loader.resolve (internal/modules/esm/loader.js:94:40)
8|api | at Loader.getModuleJob (internal/modules/esm/loader.js:240:28)
8|api | at Loader.import (internal/modules/esm/loader.js:175:28)
8|api | at importModuleDynamically (internal/modules/cjs/loader.js:1090:27)
8|api | at exports.importModuleDynamicallyCallback (internal/process/esm_loader.js:37:14)
8|api | at Object. (C:\Users\Nate\AppData\Roaming\npm\node_modules\pm2\lib\ProcessContainerFork.js:29:24)
8|api | at Module._compile (internal/modules/cjs/loader.js:1147:30)
8|api | at Object.Module._extensions..js (internal/modules/cjs/loader.js:1167:10)
8|api | at Module.load (internal/modules/cjs/loader.js:996:32) {
8|api | code: 'ERR_UNSUPPORTED_ESM_URL_SCHEME'
8|api | }

How could we reproduce this issue?

run pm2 on module where package.json has "type":"module"

Supporting information

The same command on the same project works fine on Linux.

Report

$ pm2 report

--- PM2 report ----------------------------------------------------------------
Date                 : Tue Apr 28 2020 12:01:38 GMT+0200 (Central European Summer Time)
===============================================================================
--- Daemon --------------------------------------------------------------------
pm2d version         : 4.4.0
node version         : 13.12.0
node path            : F:/programs/nodejs/node
argv                 : F:\programs\nodejs\node.exe,C:\Users\Nate\AppData\Roaming\npm\node_modules\pm2\lib\Daemon.js
argv0                : node
user                 : undefined
uid                  : N/A
gid                  : N/A
uptime               : 8min
===============================================================================
--- CLI -----------------------------------------------------------------------
local pm2            : 4.4.0
node version         : 13.12.0
node path            : F:/programs/nodejs/node
argv                 : F:\programs\nodejs\node.exe,C:\Users\Nate\AppData\Roaming\npm\node_modules\pm2\bin\pm2,report
argv0                : F:\programs\nodejs\node.exe
user                 : Nate
===============================================================================
--- System info ---------------------------------------------------------------
arch                 : x64
platform             : win32
type                 : Windows_NT
cpus                 : Intel(R) Core(TM) i7-4700MQ CPU @ 2.40GHz
cpus nb              : 8
freemem              : 18371026944
totalmem             : 25642827776
home                 : C:\Users\Nate
===============================================================================
--- PM2 list ------------------------------------------------------------------
┌─────┬──────────┬─────────────┬─────────┬─────────┬──────────┬────────┬──────┬───────────┬──────────┬──────────┬──────────┬──────────┐
│ id  │ name     │ namespace   │ version │ mode    │ pid      │ uptime │ ↺    │ status    │ cpu      │ mem      │ user     │ watching │
├─────┼──────────┼─────────────┼─────────┼─────────┼──────────┼────────┼──────┼───────────┼──────────┼──────────┼──────────┼──────────┤
│ 8   │ api      │ default     │ 0.0.0   │ fork    │ 2672     │ 6m     │ 0    │ online    │ 0%       │ 23.9mb   │ Nate    │ disabled │
│ 0   │ react    │ default     │ 0.0.1   │ fork    │ 9656     │ 7m     │ 0    │ online    │ 0.2%     │ 24.2mb   │ Nate    │ disabled │
└─────┴──────────┴─────────────┴─────────┴─────────┴──────────┴────────┴──────┴───────────┴──────────┴──────────┴──────────┴──────────┘
[PM2][WARN] Current process list running is not in sync with saved list. Type 'pm2 save' to synchronize or enable autosync via 'pm2 set pm2:autodump true'
===============================================================================
--- Daemon logs ---------------------------------------------------------------
C:\Users\Nate\.pm2\pm2.log last 20 lines:
PM2        | 2020-04-28T11:54:38: PM2 log: App [api:1] exited with code [1] via signal [SIGINT]
PM2        | 2020-04-28T11:54:38: PM2 log: App name:api id:3 disconnected
PM2        | 2020-04-28T11:54:38: PM2 log: App [api:3] exited with code [1] via signal [SIGINT]
PM2        | 2020-04-28T11:54:38: PM2 log: App name:api id:4 disconnected
PM2        | 2020-04-28T11:54:38: PM2 log: App [api:4] exited with code [1] via signal [SIGINT]
PM2        | 2020-04-28T11:54:38: PM2 log: App name:api id:5 disconnected
PM2        | 2020-04-28T11:54:38: PM2 log: App [api:5] exited with code [1] via signal [SIGINT]
PM2        | 2020-04-28T11:54:38: PM2 log: App name:api id:6 disconnected
PM2        | 2020-04-28T11:54:38: PM2 log: App [api:6] exited with code [1] via signal [SIGINT]
PM2        | 2020-04-28T11:54:38: PM2 log: App name:api id:7 disconnected
PM2        | 2020-04-28T11:54:38: PM2 log: App [api:7] exited with code [1] via signal [SIGINT]
PM2        | 2020-04-28T11:54:38: PM2 log: pid=2672 msg=process killed
PM2        | 2020-04-28T11:54:38: PM2 log: pid=6788 msg=process killed
PM2        | 2020-04-28T11:54:38: PM2 log: pid=6168 msg=process killed
PM2        | 2020-04-28T11:54:38: PM2 log: pid=10624 msg=process killed
PM2        | 2020-04-28T11:54:38: PM2 log: pid=1200 msg=process killed
PM2        | 2020-04-28T11:54:38: PM2 log: pid=9004 msg=process killed
PM2        | 2020-04-28T11:54:38: PM2 log: pid=3580 msg=process killed
PM2        | 2020-04-28T11:54:54: PM2 log: App [api:8] starting in -fork mode-
PM2        | 2020-04-28T11:54:54: PM2 log: App [api:8] online

@T1MOXA
Copy link

T1MOXA commented May 23, 2020

Any updates ?

@stale
Copy link

stale bot commented Jun 22, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Jun 22, 2020
@stale stale bot closed this as completed Jul 6, 2020
@fwgood
Copy link

fwgood commented Aug 15, 2020

I have the same problem

@Forux
Copy link

Forux commented Aug 18, 2020

I have the same problem.

pm2 4.4.1
nodejs 13.12.00
nodejs 14.8.0

Windows 10

All workarounds not working. Please fix this!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants