Search code examples
reactjsnpmgulpenvironment-variables

The problem with the launch of the project gulp


Can't run project.
When you enter the "gulp default", errors do not occur.
When you enter "serve serve", this error is displayed:

Browserify Error { 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:
"C:\\OpenServer\\domains\\yarmobile.local\\node_modules\\babel-preset-react-
app\\index.js") while parsing file:
C:\OpenServer\domains\yarmobile.local\src\app\main.js

Solution

  • your gulp file should contain the below-mentioned task.

    gulp.task('serve', ['set-development']);
    gulp.task('default', ['serve']);