Error: Using `babel-preset-react-app` requires that you specify `NODE_ENV` or `BABEL_ENV`
Created by: 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
Environment
Run these commands in the project folder and fill in their results:
-
npm ls react-scripts
(if you haven’t ejected):
memberzone@0.1.0 /Users/nboisvert/Git/memberzone
└── react-scripts@1.0.6
-
node -v
:v6.2.1
-
npm -v
:4.6.1
Then, specify:
- Operating system: macOS Sierrra 10.12.5
- Browser and version: Google Chrome Version 58.0.3029.110 (64-bit)
Reproducible Demo
Didn't add anything. Fresh install