Where communities thrive

  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
Repo info
    Sedric Heidarizarei
    I'm confused, I Can run 2 project in 2 terminal in windows then why should I choose pm2?, I need run 2 project in one terminal or 1 server like heroku, Can I do That with pm2? do you have an example?
    Kai Schwarz
    @saeedhei you might try out cross-env NODE_ENV=development nodemon --exec 'node --require @babel/register' src/index1.js" && cross-env NODE_ENV=development nodemon --exec 'node --require @babel/register' src/index2.js"
    but i am really not sure if a) this works or b) it does what you want
    it will also not execute 2nd script if 1st one fails
    Sedric Heidarizarei
    I will want to run 2 telegram bot , Thanks, I will Check That.
    Kai Schwarz
    alternative: realize a nodejs script that handles both telegram bot instances, then you are fine
    I am trying to deploy with PM2, but all I get is "Deploy failed", but no error log
    nothing to help me to fix it =(
    Any idea?
    I just need to "activate" some logs to see the error and how to fix it
    Aigars Cibulskis
    Hey, I am trying to get use of pm2-dev with ecosystem file, and each of my applications have different watch and ignore_watch. But it does not seem to work when I run pm2-dev start ecosystem.dev.json. Is it even possible?
    Sourav Chatterjee
    Hi I am Starting my App using .json file and have configured Logging in the same
    Is it possible to programatically access the Logs
    in a JSON format maybe?
    Any help would be much appreciated
    Karthik Iyengar
    Is there any benefit to running cluster mode on a single core instance?
    Jemmy Phan
    typescript user here?
    ever faced ts-node not loading tsconfig.json?
    Anthony Garo
    hey guys
    How do i set all logging to go to STDOUT ?
    @agaro1121 You can use pm2 logs id
    or use pm2 monit
    nikhil jain
    @agaro1121 if you are using bunyan package then just skip streams portion empty.this will work
    David Richardson

    Is it possible to start a rails server with pm2?

    In my ecosystem.config.js I've got something like:

          name: 'rails-api',
          script: 'bundle exec rails s -p 3001 -b',
          cwd: './api',
          interpreter: 'bash',

    I've tried using bash and also setting interpreter to none and running the binary ./api/bin/rails

    @daverich204, I also tryed to run rails server with pm2, but no success =(
    Konstantin Kostiuk
    hi guys, I'm trying to run serverless invoke inside pm2 but then i don't see lamda output in pm2 logs
    I'm not sure either this is pm2 issue or related to serverless-webpack I'm using
    I have created an issue there serverless-heaven/serverless-webpack#464
    can you please participate?
    Hi guys, I need some help. I am running a typescript project, for dev I ran it with "nodemon --exec ./node_modules/.bin/ts-node -- ./server.ts" now I want to run it on a amachine with pm2 and I get promise errors for async await I guess error TS2468: Cannot find global value 'Promise'.
    error TS2705: An async function or method in ES5/ES3 requires the 'Promise' constructor. Make sure you have a declaration for the 'Promise' constructor or include 'ES2015' in your --lib option. I tries installing typescript with pm2 pm2 install typescript and it didn't work. Can anyoane suggest something, please?

    I notice the part : Serve static file over HTTP.

    I use the command: pm2 serve ./dist/ 8080, and it be valid just for the SPA page (for the root index.html file, http://localhost:8080/).

    But I would like that it could also for other html files (like http://localhost:8080/other.html or http://localhost:8080/me/about.html). It just like a Nginx (a server engine ).

    The PM2 can do that ? and how should I do?

    I think it will be very convenient to developers. ( just for development)
    Gladson Robinson
    On running pm2 on server am getting buffer error.
    buffer.js:269  13:38:10 throw err;  13:38:10 ^  13:38:10 RangeError [ERR_INVALID_OPT_VALUE]: The value "2147483648" is invalid for option "size"  13:38:10 at Function.alloc (buffer.js:278:3)  13:38:10 at new Buffer (buffer.js:180:19)
    any on got any info on it
    Env variables undefined when starting with pm2
    my pm2 version is@latest 3.5.1
    any one has same issue
    I solved it
    add --env production
    hello guy i have question about pm2 docker is it the right channel for that?
    can someone assit me with docker and pm2?
    pm2-runtime cannot find ecosystem.config.js...
    it seems pm2-runtime cannot see docker volume
    Hello guys, i have question about running docker -run with pm2 can someone help me?
    RYeah Sh
    Hi guys, who ever has a blog or post on Medium stuff that are related to programming, I am working on a new publishing platform, its my side project and i worked reallllly hard on it - I would love for your feedback! if you love publishing and curating content - PLEASE PM ME :)
    if my message is not following chat room rules i will delete it! thanks.
    Eder Gomez

    Hi guys, I have the following script to start my application, but I would like to know if I am indicating the parameters "-Xmx256m -Xms256m" ???:

        "apps": [{
                "name": "application",
                "cwd": "/opt/application",
                "args": [
                "env": {
                    "SPRING_PROFILES_ACTIVE": "prod",
                    "JAVA_OPTS": "-Xmx256m -Xms256m"
                "script": "/usr/bin/java",
                "node_args": [],
                "log_date_format": "YYYY-MM-DD HH:mm Z",
                "exec_interpreter": "none",
                "exec_mode": "fork"

    thanks for your help

    Barin Britva

    Hi everyone!

    Does somebody know where I can find modules installed by pm2 install [module]?


    Hi I'm trying a use-case to be able to communicate between PM2 workers. There are some examples listed here:

    Most of these examples use the sendDataToProcessId method

    But then, the official docs:

    uses something called launchBus.
    I could not find any further docs or usecases listed for launchBus

    Could someone please elaborate on the purpose of launchBus and why does it need to be used along with sendDataToProcessId ?

    How's it going, is anyone around?>
    David Raison

    Hi, did anyone ever run into this issue:

    root@b7d29d49766a:/srv# pm2-runtime cisystem.config.cjs 
    2021-09-25T14:23:20: PM2 log: Launching in no daemon mode
    2021-09-25T14:23:20: PM2 log: App [appname:0] starting in -cluster mode-
    2021-09-25T14:23:20: PM2 log: App [appname-ci:0] online
    Error: Could not find source file: '/srv/cisystem.config.cjs'.
        at getValidSourceFile (/srv/node_modules/typescript/lib/typescript.js:153651:29)
        at Object.getEmitOutput (/srv/node_modules/typescript/lib/typescript.js:154079:30)
        at getOutput (/srv/node_modules/ts-node/src/index.ts:562:32)
        at Object.compile (/srv/node_modules/ts-node/src/index.ts:775:32)
        at Module.m._compile (/srv/node_modules/ts-node/src/index.ts:858:43)
        at Module._extensions..js (internal/modules/cjs/loader.js:1101:10)
        at Object.require.extensions.<computed> [as .js] (/srv/node_modules/ts-node/src/index.ts:861:12)
        at Module.load (internal/modules/cjs/loader.js:937:32)
        at Function.Module._load (internal/modules/cjs/loader.js:778:12)
        at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:76:12)

    Basically, it says that it can't find the ecosystem file that it must have found, because "appname" is from the file.
    This is inside a docker container as you might have guessed from the hostname.

    David Raison
    Ha, never mind, just saw the last post before mine was from March