Why is process.env.NODE_ENV undefined?

process.env is a reference to your environment, so you have to set the variable there.

To set an environment variable in Windows:

SET NODE_ENV=development

on macOS / OS X or Linux:

export NODE_ENV=development

Leave a Comment

tech