0

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?

Mohamed
  • 425
  • 4
  • 14

1 Answers1

0

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"
},
Mauzzz0
  • 53
  • 1
  • 6
  • Nope that doesn't help as my Heroku log is still showing as development ```2021-10-07 23:29:07 [32minfo[39m: What value is NODE_ENV 2021-10-07 23:29:07 [32minfo[39m: development 2021-10-07 23:29:07 [32minfo[39m: What value is NODE_ENV``` Logger using winston – Mohamed Oct 07 '21 at 23:31