Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to start node app with development flag?

Tags:

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 NODE_ENV is global. How can I start my app with development settings? Thank you.

like image 406
bejm Avatar asked Oct 21 '13 20:10

bejm


1 Answers

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"
like image 156
Errol Fitzgerald Avatar answered Sep 28 '22 00:09

Errol Fitzgerald