question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Couldn't find preset "es2015" relative to directory

See original GitHub issue

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/WeFlow_workspace/WeFlow-example/src/js"

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

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:9
  • Comments:15 (2 by maintainers)

github_iconTop GitHub Comments

422reactions
rbatlletcommented, Jul 27, 2016

Have you installed these presets via npm?

babel-preset-es2015
babel-preset-stage-2
126reactions
panuhorsmalahticommented, Sep 23, 2016

The correct example would be to use the npm package names, e.g.:

presets: ["babel-preset-es2015", "babel-preset-es2016", "babel-preset-es2017"].map(require.resolve)
Read more comments on GitHub >

github_iconTop Results From Across the Web

Error: Couldn't find preset "es2015" relative to directory "/Users ...
To fix this issue You should remove .babelrc (hidden) file from "/Users/username" directory.
Read more >
【Bug】Vue解决Couldn't find preset "es2015" relative to ...
Couldn't find preset “es2015” relative to directory原因由于引入的Element-UI 使用了ES标准,所以编译会报错。解决方法安装ES 标准npm install ...
Read more >
Error: Couldn't find preset “es2015” relative to directory “/Users ...
I have the es2015 preset installed globally and locally so can't see why this would be an issue. Below is my gulp set...
Read more >
Couldn't find preset "es2015" relative to directory-Reactjs
Coding example for the question Webpack + Babel: Couldn't find preset "es2015" relative to directory-Reactjs.
Read more >
Error: Couldn't find preset "es2015" relative to directory "/Users ...
JavaScript : Error: Couldn't find preset " es2015 " relative to directory "/Users/username" [ Gift : Animated Search Engine ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found