Skip to content

Using dotenv .env config file correctly #865

Closed
@lovegrovegeorge

Description

Description

How the .env file and imports should be setup for the project correctly as currently the build is breaking.

Expected behavior

  • add .env file with config in root
  • npm install --save dotenv
  • import dotenv using require('dotenv').config(); or ES6 syntax in index.js file
  • consume using process.env.CONFIG_NAME across application

Actual behavior

screen shot 2016-10-06 at 17 45 24

Using the expected behaviour approach I get the above error. I've also tried both installing dotenv and not installing it (as ejecting the repository shows dotenv is already a dependency).

Environment

[email protected]
node - v6.6.0
npm - 3.10.8

Using a Chrome (53.0.2785.143) on a Mac.

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions