Couldn't find preset "es2015" relative to directory


#1

I’m writing a APP to compile JS. And I use gulp-babel in electron,I have all the dependencies installed.

the code is :

function compileJs(cb) {
        gulp.src(paths.src.js)
            .pipe(babel({
                presets: ['es2015', 'stage-2']
            }))
            .pipe(uglify())
            .pipe(gulp.dest(paths.tmp.js))      
    }

When I was developing, everything was all right.
Bug When I packed electron app and run , it throw:

events.js:154 Uncaught Error in plugin 'gulp-babel'
Message:
    Couldn't find preset "es2015" relative to directory "/Users/user/workspace/example/src/js"

I don’t know whose fault it is. Can you help me? Thanks.