You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The following ecosystem config refuses to run because it's formatted as an ES Module, but it works fine under my host machine:
exportconstapps=[{name: "xivi",script: "bun install && bun run build && bun run start",interpreter: "none",exec_mode: "fork",instances: 1,autorestart: true,watch: false,max_memory_restart: "1G",env: {PATH: `${process.env.HOME}/.bun/bin:${process.env.PATH}`,},},];
error on remote machine:
$ pm2 start; pm2 save --force
[PM2][ERROR] File ecosystem.config.js malformated
Error [ERR_REQUIRE_ESM]: require() of ES Module /home/nova/Xivi15/ecosystem.config.js from /home/nova/Xivi15/node_modules/pm2/lib/Common.js not supported.
Instead change the require of ecosystem.config.js in /home/nova/Xivi15/node_modules/pm2/lib/Common.js to a dynamic import() which is available in all CommonJS modules.
at Common.parseConfig (/home/nova/Xivi15/node_modules/pm2/lib/Common.js:331:12)
at API._startJson (/home/nova/Xivi15/node_modules/pm2/lib/API.js:934:25)
at API.start (/home/nova/Xivi15/node_modules/pm2/lib/API.js:329:12)
at /home/nova/Xivi15/node_modules/pm2/lib/binaries/CLI.js:292:13
at /home/nova/Xivi15/node_modules/async/internal/withoutIndex.js:8:40 {
code: 'ERR_REQUIRE_ESM'
}
[PM2] Saving current process list...
[PM2] Successfully saved in /home/nova/.pm2/dump.pm2
on my own machine, heres what happens:
❯ bun run pm2:start
$ pm2 start; pm2 save --force
[PM2] Applying action restartProcessId on app [xivi](ids: [ 0 ])
[PM2] [xivi](0) ✓
┌────┬─────────┬─────────────┬─────────┬─────────┬──────────┬────────┬──────┬───────────┬──────────┬──────────┬──────────┬──────────┐
│ id │ name │ namespace │ version │ mode │ pid │ uptime │ ↺ │ status │ cpu │ mem │ user │ watching │
├────┼─────────┼─────────────┼─────────┼─────────┼──────────┼────────┼──────┼───────────┼──────────┼──────────┼──────────┼──────────┤
│ 0 │ xivi │ default │ N/A │ fork │ 361545 │ 0s │ 1 │ online │ 0% │ 5.3mb │ nova │ disabled │
└────┴─────────┴─────────────┴─────────┴─────────┴──────────┴────────┴──────┴───────────┴──────────┴──────────┴──────────┴──────────┘
[PM2] Saving current process list...
[PM2] Successfully saved in /home/nova/.pm2/dump.pm2
the only difference between my main machine and the remote machine is my main is on arch linux and the remote is debian 12
The text was updated successfully, but these errors were encountered:
❯ bun run pm2:start
$ pm2 start; pm2 save --force
[PM2][ERROR] File ecosystem.config.js malformated
Error [ERR_REQUIRE_ESM]: require() of ES Module /home/nova/Xivi15/ecosystem.config.js from /home/nova/Xivi15/node_modules/pm2/lib/Common.js not supported.
ecosystem.config.js is treated as an ES module file as it is a .js file whose nearest parent package.json contains "type": "module" which declares all .js files in that package scope as ES modules.
Instead either rename ecosystem.config.js to end in .cjs, change the requiring code to use dynamic import() which is available in all CommonJS modules, or change "type": "module" to "type": "commonjs" in /home/nova/Xivi15/package.json to treat all .js files as CommonJS (using .mjs for all ES modules instead).
at Common.parseConfig (/home/nova/Xivi15/node_modules/pm2/lib/Common.js:331:12)
at API._startJson (/home/nova/Xivi15/node_modules/pm2/lib/API.js:934:25)
at API.start (/home/nova/Xivi15/node_modules/pm2/lib/API.js:329:12)
at /home/nova/Xivi15/node_modules/pm2/lib/binaries/CLI.js:292:13
at /home/nova/Xivi15/node_modules/async/internal/withoutIndex.js:8:40 {
code: 'ERR_REQUIRE_ESM'
}
[PM2] Saving current process list...
[PM2] Successfully saved in /home/nova/.pm2/dump.pm2
The following ecosystem config refuses to run because it's formatted as an ES Module, but it works fine under my host machine:
error on remote machine:
on my own machine, heres what happens:
the only difference between my main machine and the remote machine is my main is on arch linux and the remote is debian 12
The text was updated successfully, but these errors were encountered: