Checking node_env in node.js

Viewed 17

enter image description here

enter image description here

Hello, I set the NODE_ENV in my dev env as development. When I console log the NODE_ENV it give me development, but when I do a compare it gives me false. Does anybody know what is it happening?

1 Answers

maybe you need to set the variable of NODE_ENV first.

like if you using windows

SET NODE_ENV=development

or Mac/linux

export NODE_ENV=development
Related