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

migrate to bun #5774

Open
Mrgaton opened this issue Feb 23, 2024 · 6 comments
Open

migrate to bun #5774

Mrgaton opened this issue Feb 23, 2024 · 6 comments

Comments

@Mrgaton
Copy link

Mrgaton commented Feb 23, 2024

pm2 logs uses 30% of resources of my machine, im using it on a potato but a bun version would be great

@ultimate-tester
Copy link

You want to use bun as interpreter?

pm2 start --interpreter ~/.bun/bin/bun

@Mrgaton
Copy link
Author

Mrgaton commented Feb 29, 2024

Won't be nice to make that as default?

I don't see any disadvantage of not using bun

@ultimate-tester
Copy link

ultimate-tester commented Feb 29, 2024

It won't be as easy as just stating "let's make a different interpreter the default".
Here's some cons just for sake of argument:

  • Bun is still under development.
  • Bun is not as widely used as Node.js.
  • Bun does not support all Node.js APIs.
  • Bun is not as well-documented as Node.js.

So, while Node.js is still the most popular, complete and stable production-ready interpreter, in my opinion PM2 should stick with it and only start discussing about it when Node.js is surpassed in those areas.

Nothing against Bun, but you have to be realistic.

@Mrgaton
Copy link
Author

Mrgaton commented Feb 29, 2024

You want to use bun as interpreter?

pm2 start --interpreter ~/.bun/bin/bun

how i can make it permament and then how i can leave it as default?

@ultimate-tester
Copy link

ultimate-tester commented Feb 29, 2024

Actually coming back to this, it seems that bun is the default already for typescript (bad decision if you ask me) since oct 6 2023:
135c123

That would mean that if you really want to use bun by default, either modify that file manually or use typescript extension.

@tapz
Copy link

tapz commented Mar 7, 2024

I can't get pm2 to work with bun at all. Whatever I do pm2 always gives this error:

/usr/bin/env: 'node': No such file or directory

I have tried with command line arguments and with a configuration file. Still it seems to ignore the interpreter argument completely.

.bun/bin/pm2 start ecosystem.json
.bun/bin/pm2 start --interpreter bun index.js
.bun/bin/pm2 start --interpreter /usr/local/bin/bun index.js

ecosystem.json:

{
  "apps": [
    {
      "name": "myapp",
      "script": "index.js",
      "interpreter": "/usr/local/bin/bun",
      "instances": 1,
      "exec_mode": "fork",
      "autorestart": true,
      "watch": false,
      "error_file": "./errors.log",
      "out_file": "./myapp.log"
    }
  ]
}

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

No branches or pull requests

3 participants