1

I'm trying to set the NODE_ENV variable and other ones in the production environment.

When I log in and do:

$ export NODE_ENV=production

It works. I can then check the variable with:

$ echo $NODE_ENV

The result is "production"

But if I log out and log in again the variable is empty, why is this happening? How can I set the environment variables persistently?

  • You would need to set it in your shell profile. think `.bashrc` or `.profile` all depending on your system. – ChristianM Mar 16 '18 at 17:21
  • https://stackoverflow.com/questions/13046624/how-to-permanently-export-a-variable-in-linux – Alejandro Montilla Mar 16 '18 at 17:24
  • Possible duplicate of [How to permanently export a variable in Linux?](https://stackoverflow.com/questions/13046624/how-to-permanently-export-a-variable-in-linux) – rtn Mar 16 '18 at 22:42

0 Answers0