Unitech / Unitech/pm2

when running npm commands, the process name is always shell

Open
#5,904 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
43.3k
Forks
2.7k
PR merge metrics
No merged PRs in 30d

Description

What's going wrong?

I am trying to run several projects with pm2 using npm scripts, but each process name is always "shell" even when explicitly set in a json config.

How could we reproduce this issue?

have a config like

{
  "apps": [
    {
      "name": "api-server",
      "script": "npm",
      "args": "run start"
    },
}

and notice that the process's name is "shell" and not "api-server"

Supporting information

--- PM2 report ----------------------------------------------------------------
Date                 : Tue Oct 15 2024 11:41:29 GMT-0400 (Eastern Daylight Time)
===============================================================================
--- Daemon -------------------------------------------------
pm2d version         : 5.4.2
node version         : 20.17.0
node path            : /nix/store/90wa8dsnqbr9fd3kybk9ir1kf82bfrqa-pm2-5.4.2/bin/pm2
argv                 : /nix/store/w78sh036dyn14f29w8za9ni9syrmwm3q-nodejs-20.17.0/bin/node,/nix/store/90wa8dsnqbr9fd3kybk9ir1kf82bfrqa-pm2-5.4.2/lib/node_modules/pm2/lib/Daemon.js
argv0                : node
user                 : benbot
uid                  : 1000
gid                  : 100
uptime               : 6min
===============================================================================
--- CLI ----------------------------------------------------
local pm2            : 5.4.2
node version         : 20.17.0
node path            : /nix/store/90wa8dsnqbr9fd3kybk9ir1kf82bfrqa-pm2-5.4.2/bin/pm2
argv                 : /nix/store/w78sh036dyn14f29w8za9ni9syrmwm3q-nodejs-20.17.0/bin/node,/nix/store/90wa8dsnqbr9fd3kybk9ir1kf82bfrqa-pm2-5.4.2/lib/node_modules/pm2/bin/pm2,report
argv0                : /nix/store/w78sh036dyn14f29w8za9ni9syrmwm3q-nodejs-20.17.0/bin/node
user                 : benbot
uid                  : 1000
gid                  : 100
===============================================================================
--- System info --------------------------------------------
arch                 : x64
platform             : linux
type                 : Linux
cpus                 : AMD Ryzen 9 7900X 12-Core Processor
cpus nb              : 24
freemem              : 122684841984
totalmem             : 134159986688
home                 : /home/benbot
===============================================================================
--- PM2 list -----------------------------------------------
┌────┬──────────┬─────────────┬─────────┬─────────┬──────────┬────────┬──────┬───────────┬──────────┬──────────┬──────────┬──────────┐
│ id │ name     │ namespace   │ version │ mode    │ pid      │ uptime │ ↺    │ status    │ cpu      │ mem      │ user     │ watching │
├────┼──────────┼─────────────┼─────────┼─────────┼──────────┼────────┼──────┼───────────┼──────────┼──────────┼──────────┼──────────┤
│ 0  │ shell    │ default     │ N/A     │ fork    │ 72652    │ 5m     │ 0    │ online    │ 0%       │ 57.4mb   │ benbot   │ disabled │
│ 1  │ shell    │ default     │ N/A     │ fork    │ 72653    │ 5m     │ 0    │ online    │ 0.1%     │ 57.3mb   │ benbot   │ disabled │
│ 2  │ shell    │ default     │ N/A     │ fork    │ 72663    │ 5m     │ 0    │ online    │ 0%       │ 56.9mb   │ benbot   │ disabled │
│ 3  │ shell    │ default     │ N/A     │ fork    │ 72673    │ 5m     │ 0    │ online    │ 0.1%     │ 57.4mb   │ benbot   │ disabled │
│ 4  │ shell    │ default     │ N/A     │ fork    │ 72693    │ 5m     │ 0    │ online    │ 0.1%     │ 57.8mb   │ benbot   │ disabled │
│ 5  │ shell    │ default     │ N/A     │ fork    │ 72694    │ 5m     │ 0    │ online    │ 0.1%     │ 57.5mb   │ benbot   │ disabled │
│ 6  │ shell    │ default     │ N/A     │ fork    │ 72705    │ 5m     │ 0    │ online    │ 0.1%     │ 56.8mb   │ benbot   │ disabled │
└────┴──────────┴─────────────┴─────────┴─────────┴──────────┴────────┴──────┴───────────┴──────────┴──────────┴──────────┴──────────┘
===============================================================================
--- Daemon logs --------------------------------------------
/home/benbot/.pm2/pm2.log last 20 lines:
PM2        | 2024-10-15T11:34:44: PM2 log: Application log path : /home/benbot/.pm2/logs
PM2        | 2024-10-15T11:34:44: PM2 log: Worker Interval      : 30000
PM2        | 2024-10-15T11:34:44: PM2 log: Process dump file    : /home/benbot/.pm2/dump.pm2
PM2        | 2024-10-15T11:34:44: PM2 log: Concurrent actions   : 2
PM2        | 2024-10-15T11:34:44: PM2 log: SIGTERM timeout      : 1600
PM2        | 2024-10-15T11:34:44: PM2 log: ===============================================================================
PM2        | 2024-10-15T11:36:25: PM2 log: App [shell:0] starting in -fork mode-
PM2        | 2024-10-15T11:36:25: PM2 log: App [shell:1] starting in -fork mode-
PM2        | 2024-10-15T11:36:25: PM2 log: App [shell:0] online
PM2        | 2024-10-15T11:36:25: PM2 log: App [shell:1] online
PM2        | 2024-10-15T11:36:25: PM2 log: App [shell:2] starting in -fork mode-
PM2        | 2024-10-15T11:36:25: PM2 log: App [shell:2] online
PM2        | 2024-10-15T11:36:25: PM2 log: App [shell:3] starting in -fork mode-
PM2        | 2024-10-15T11:36:25: PM2 log: App [shell:3] online
PM2        | 2024-10-15T11:36:25: PM2 log: App [shell:4] starting in -fork mode-
PM2        | 2024-10-15T11:36:25: PM2 log: App [shell:4] online
PM2        | 2024-10-15T11:36:25: PM2 log: App [shell:5] starting in -fork mode-
PM2        | 2024-10-15T11:36:25: PM2 log: App [shell:5] online
PM2        | 2024-10-15T11:36:25: PM2 log: App [shell:6] starting in -fork mode-
PM2        | 2024-10-15T11:36:25: PM2 log: App [shell:6] online

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

No source file, test, or entry point is identified in the report. Reproduce the issue with the shown PM2 JSON configuration and npm command, then trace how PM2 names npm-launched processes; done means configured names such as "api-server" appear in the PM2 list instead of "shell".

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, nodejs
Domain
cli
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.