How to start node app with development flag?

前端 未结 5 630
梦如初夏
梦如初夏 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:11

    It is better to start your app in dev mode like this:

    NODE_ENV=development node app.js
    

    But if you really wanted to set it your app file just set it like this:

    process.env.NODE_ENV= "development"
    

提交回复
热议问题