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.

Error: Couldn't find preset

See original GitHub issue

Am on babelify version 7.1, and browserify version 12.0.1.

I’m using the CLI to create a build file, and am getting an error. As far as I can tell, I’m doing everything the vanilla, correct way. If I take out presets option, I get unexepcted token errors.

Here’s the command I’m running:

browserify -e src/index.js -t [ babelify --presets es2015 ] -o dist/mandolin.js -s mandolin

And here’s the error and stack:

Error: Couldn't find preset while parsing file: <root_dir>/src/index.js
    at OptionManager.mergePresets (<root_dir>/node_modules/babelify/node_modules/babel-core/lib/transformation/file/options/option-manager.js:309:17)
    at OptionManager.mergeOptions (<root_dir>/node_modules/babelify/node_modules/babel-core/lib/transformation/file/options/option-manager.js:269:12)
    at OptionManager.init (<root_dir>/node_modules/babelify/node_modules/babel-core/lib/transformation/file/options/option-manager.js:395:10)
    at File.initOptions (<root_dir>/node_modules/babelify/node_modules/babel-core/lib/transformation/file/index.js:191:75)
    at new File (<root_dir>/node_modules/babelify/node_modules/babel-core/lib/transformation/file/index.js:122:22)
    at Pipeline.transform (<root_dir>/node_modules/babelify/node_modules/babel-core/lib/transformation/pipeline.js:42:16)
    at Babelify._flush (<root_dir>/node_modules/babelify/index.js:28:24)
    at Babelify.<anonymous> (_stream_transform.js:130:12)
    at Babelify.g (events.js:180:16)
    at Babelify.EventEmitter.emit (events.js:117:20)

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:12 (3 by maintainers)

github_iconTop GitHub Comments

12reactions
ORESoftwarecommented, Oct 25, 2017

$ npm install --save-dev babel-preset-stage-3

was solution for me

6reactions
andolfcommented, Nov 1, 2015

Googled around a bit and this solved my issue: Install babel-preset-es2015 via NPM and also babel-preset-react if you’re also running React.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Couldn't find preset "env" relative to directory - Stack Overflow
Basically, this type of error occurs due to mismatch in versions of babel-core, babel-preset-env and babel-loader.
Read more >
Babel Couldn't find preset "@babel/preset-env"(with ... - GitHub
im getting Couldn't find preset "@babel/preset-env" error with message Error: Couldn't find preset "@babel/preset-env" relative to directory ...
Read more >
Error: Couldn't find preset "@babel/preset-env" relative to ...
Hi, I'm trying to run the project locally on my Windows machine. Unfortunately, v-click-outside is trying to resolve preset ...
Read more >
Couldn't find preset "env" relative to directory Error while ...
Getting error while running jss start at my local, attached screen shot for same." Couldn't find preset "env" relative to directory ...
Read more >
Error: Couldn't find preset “es2015” relative to directory - 北鱼IT
Error: Couldn't find preset “es2015” relative to directory. 问题. 使用babel转换代码时报如下错误:.
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