20403 (1) [Avatar] Offline
#1
I was seeing this error when running
npm run dev


ERROR in ./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/kevin/Documents/letters-social/node_modules/babel-preset-react-app/index.js")
    at Object.<anonymous> (/Users/kevin/Documents/letters-social/node_modules/babel-preset-react-app/index.js:47:9)
    at Module._compile (module.js:643:30)
    at Object.Module._extensions..js (module.js:654:10)
    at Module.load (module.js:556:32)
    at tryModuleLoad (module.js:499:12)
    at Function.Module._load (module.js:491:3)
    at Module.require (module.js:587:17)
    at require (internal/module.js:11:18)
    at /Users/kevin/Documents/letters-social/node_modules/babel-core/lib/transformation/file/options/option-manager.js:296:17
    at Array.map (<anonymous>)
    at OptionManager.resolvePresets (/Users/kevin/Documents/letters-social/node_modules/babel-core/lib/transformation/file/options/option-manager.js:275:20)
    at OptionManager.mergePresets (/Users/kevin/Documents/letters-social/node_modules/babel-core/lib/transformation/file/options/option-manager.js:264:10)
    at OptionManager.mergeOptions (/Users/kevin/Documents/letters-social/node_modules/babel-core/lib/transformation/file/options/option-manager.js:249:14)
    at OptionManager.init (/Users/kevin/Documents/letters-social/node_modules/babel-core/lib/transformation/file/options/option-manager.js:368:12)
    at File.initOptions (/Users/kevin/Documents/letters-social/node_modules/babel-core/lib/transformation/file/index.js:212:65)
    at new File (/Users/kevin/Documents/letters-social/node_modules/babel-core/lib/transformation/file/index.js:135:24)
 @ multi (webpack)-dev-server/client?http://localhost:3000 webpack/hot/dev-server ./src/index


To fix I needed to change this line in /package.json from:
"dev": "npm-run-all -p api client:dev server:dev styles:w",

to:
"dev": "NODE_ENV=development npm-run-all -p api client:dev server:dev styles:w",


In case anyone else runs into it!