Skip to content

Can't use config file with bun.js and next.js #6072

@jim-king-2000

Description

@jim-king-2000

Here is the usage of PM2 with bun: https://bun.com/docs/guides/ecosystem/pm2#with-a-configuration-file.

This is the example it shows above:

module.exports = {
title: "app", // Name of your application
script: "index.ts", // Entry point of your application
interpreter: "bun", // Bun interpreter
env: {
PATH: ${process.env.HOME}/.bun/bin:${process.env.PATH}, // Add "~/.bun/bin/bun" to PATH
},
};

But we are using next.js. There is no specific startup file such as "index.ts" above. So we have to run "bun run start" from PM2.

This is the available solution:
pm2 start bun --name my_proj_name -- start

But how to translate the command to a config file? I try to fill bun run start in the script field, but PM2 does not accept it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions