Unitech / Unitech/pm2

PM2 starting flag ```--name or ```name in config will attach ```name on ```process.env``

Open
#4,943 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?

PM2 starting flag --name or name in config will attach ${PM2_APP_NAME} on process.env, which override the original process.env.${OTHER_FRAMEWORK_VARIABLES}, which makes other frameworks or library doesnt properly retrive originals, which maybe loaded from .env and makes it doesnt boot properly (e.g: @nestjs/config)

How could we reproduce this issue?

pm2 start ${APP} --name ${SOME_APP_NAME_OVERRIDE_ENV_VAR}

Possible Solution

use PM2_ prefix when pm2 attaches variable to process.env

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

Reproduce the issue with the shown pm2 start command and with a name value in config, then trace where PM2 attaches variables to process.env. Done means PM2-specific variables no longer overwrite existing framework environment variables, including the reported @nestjs/config case.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, node.js
Domain
cli, devtools
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.