Skip to content

Error: Using babel-preset-react-app requires that you specify NODE_ENV or BABEL_ENV #2377

Closed
@nicklayb

Description

@nicklayb

Can you reproduce the problem with latest npm?

yes

Can you still reproduce it?

yes

Description

When creating a new react app with create-react-app without doing anything, only running yarn start gives the following error :

Failed to compile.
./src/index.js
Module build failed: Error: Using `babel-preset-react-app` requires that you specify `NODE_ENV` or `BABEL_ENV` environment variables. Valid values are "development", "test", and "production". Instead, received: "undefined".
 (While processing preset: "/Users/nboisvert/Git/memberzone/node_modules/babel-preset-react-app/index.js")
    at Array.map (native)

Expected behavior

Run the template React app

Actual behavior

Displays :
image

Environment

Run these commands in the project folder and fill in their results:

  1. npm ls react-scripts (if you haven’t ejected):
memberzone@0.1.0 /Users/nboisvert/Git/memberzone
└── react-scripts@1.0.6
  1. node -v:
    v6.2.1
  2. npm -v:
    4.6.1

Then, specify:

  1. Operating system:
    macOS Sierrra 10.12.5
  2. Browser and version:
    Google Chrome Version 58.0.3029.110 (64-bit)

Reproducible Demo

Didn't add anything. Fresh install

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions