pm2 icon indicating copy to clipboard operation
pm2 copied to clipboard

Doesn't work with bun

Open Lucienest opened this issue 2 years ago • 11 comments
trafficstars

Pm2 doesn't work with bun Please add support for it

Lucienest avatar Sep 19 '23 09:09 Lucienest

Yea that would be cool!

melroy89 avatar Sep 25 '23 01:09 melroy89

How do you see the PM2 support with bun ?

Unitech avatar Oct 06 '23 03:10 Unitech

#5682

Unitech avatar Oct 06 '23 03:10 Unitech

How do you see the PM2 support with bun ?

im not sure, the pm2 need fixes so it won't crash with bun

Lucienest avatar Oct 08 '23 14:10 Lucienest

Or.. bun need fixes so Bun works with PM2 🤣 ...?

melroy89 avatar Oct 08 '23 21:10 melroy89

the fork mode is working

will be really nice, if we can have support for cluster mode

CleanShot 2024-01-21 at 02 36 25

TiBianMod avatar Jan 21 '24 01:01 TiBianMod

I'm asking bun since day 1 bun was announced to implement cluster support. And they still are not focused on implementing nodejs cluster support. Which is a huge shame. Instead they are releasing thinks like "Bun Shell" and nobody was really asking for.🤔😭

melroy89 avatar Jan 21 '24 01:01 melroy89

hehe

you can run cluster with bun on linux

this is not working on mac 😢

spawn.ts

import { join } from "node:path";
import { spawn } from "bun";

const threads = 10;

for (let i = 0; i < threads; i++) {
    spawn({
        cmd: ["bun", join(import.meta.dir, "server.ts")],
    });
}

NODE_ENV=production bun src/spawn.ts

TiBianMod avatar Jan 21 '24 02:01 TiBianMod

That is not backwards compatible with nodejs. Hence the request to have cluster support in bun. After all the goal of bun was to become a drop in replacement of nodejs after all. At least that is what they said themselves with v1.0.

melroy89 avatar Jan 21 '24 03:01 melroy89

let's see, we need to wait, hehe

TiBianMod avatar Jan 21 '24 03:01 TiBianMod

Hi guys, while you are waiting in this ticket, it seems that bun already made its way into the latest version of PM2: https://github.com/Unitech/pm2/commit/135c123adcb207f9c544bcc6c6853c3f8488fb31

This version was released as a MINOR version but the default interpreter has changed from ts-node to bun for typescript. WHY was this accepted? This is a huge change as you all know bun is not a direct drop-in replacement!

PLEASE revert that commit as soon as possible and go back to ts-node for typescript. Why on earth would an incompatible interpreter be chosen to be the default? It doesn't have have proper Windows support and is still missing nodejs implementations and documentation. Bun is nice, but NOT for production right this moment.

ultimate-tester avatar Feb 29 '24 15:02 ultimate-tester