Heroku NODE_ENV is set for me as development instead off production

243 Views Asked by At

Hi from everywhere I have read about the Heroku environment variable NODE_ENV is that they set it as production for everyone but for me some odd reason it is set for me as development. How can I change it back to production?

I have even tried to force it to be production by going to settings then Reveal config vars and manually putting in NODE_ENV production. but as I tested it out with winston logger I get back that NODE_ENV is development. This is very strange.

Why is it like this for me?

1

There are 1 best solutions below

1
On

Try install cross-env and add cross-env NODE_ENV=*MODE* to you'r npm start script in package.json, like this:

"scripts": {
  "start": "cross-env NODE_ENV=production nest start"
},