I\'m trying to follow a tutorial on NodeJs. I don\'t think I missed anything but whenever I call the process.env.NODE_ENV the only value I get back is undefine
In macOS for those who are using the express version 4.x.x and using the DOTENV plugin, need to use like this:
After installing the plugin import like the following in the file where you init the application:
require('dotenv').config({path: path.resolve(__dirname+'/.env')});
In the root directory create a file '.env' and add the varaiable like:
NODE_ENV=development
or
NODE_ENV = development