DEV Community

Kitanga Nday
Kitanga Nday

Posted on

1

Bunjs with PM2

Motivation

I am using Bunjs for the backend for my Multiplayer naval game, Sunbaked.

Now, I wanted to have my server auto-restart when a server breaking error is thrown. I read through the official guide on how to use PM2 with Bunjs but found that it missed one small piece of info...

$ bun install -g pm2

Article done

That's it, don't install pm2 using npm, you'll end up with way more problems than you need.

You then run $ pm2 start --interpreter ~/.bun/bin/bun index.ts and you are good to go.

Top comments (0)

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more