#Updating process env using pm2

16 messages · Page 1 of 1 (latest)

ruby furnace
#

Im trying to change env a process (using pm2.restart() ex: pm2.restart(processId, {env: ... }) ) but it says Error: Using --env [env] without passing the ecosystem.config.js does not work

dawn matrixBOT
#
  • Consider reading #how-to-get-help to improve your question!
  • Explain what exactly your issue is.
  • Post the full error stack trace, not just the top part!
  • Show your code!
  • Issue solved? Press the button!
mighty hinge
#

the env option refers to the pm2 environment, and not the environment variables available to the process

mighty hinge
#

its in the page i sent

#

through the cli, its --update-env

ruby furnace
mighty hinge
#

this will update the env using the values available in process.env

ruby furnace
green panther
ruby furnace
ruby furnace
#

how i will edit the env object

#

or have access to it