How to start node app with development flag?

前端 未结 5 557
梦如初夏
梦如初夏 2021-02-07 05:41

At top of my app.js file I put

NODE_ENV=\'development\';

but I get error that NODE_ENV is not defined. But in the nodejs documentation is says

5条回答
  •  误落风尘
    2021-02-07 06:20

    In order to start from cmd you can try

    NODE_ENV=development node yourappname.js
    

    If you are doing this in server where forever is installed you can mention the environment variable like

    NODE_ENV=development forever start yourappname.js
    

提交回复
热议问题