简体   繁体   中英

Heroku NODE_ENV is set for me as development instead off production

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?

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"
},

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM