Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Couldn't find preset “es2015” relative to directory #8296

Closed
hunterzhang-dev opened this issue Jun 22, 2016 · 4 comments
Closed

Couldn't find preset “es2015” relative to directory #8296

hunterzhang-dev opened this issue Jun 22, 2016 · 4 comments
Labels
Resolution: Locked This issue was locked by the bot.

Comments

@hunterzhang-dev
Copy link

When I'm trying to start a new react-native project from scratch I'm getting this message.
Error: Couldn't find preset "es2015" relative to directory "/Users/hotar/Dev/Projects"
and code is:

OptionManager.prototype.resolvePresets = function resolvePresets(presets, dirname, onResolve) {
    return presets.map(function (val) {
      if (typeof val === "string") {
        var presetLoc = (0, _resolve2.default)("babel-preset-" + val, dirname) || (0, _resolve2.default)(val, dirname);
        if (presetLoc) {
          var _val = require(presetLoc);
          onResolve && onResolve(_val, presetLoc);
          return _val;
        } else {
          throw new Error("Couldn't find preset " + (0, _stringify2.default)(val) + " relative to directory " + (0, _stringify2.default)(dirname));
        }
      } else if ((typeof val === "undefined" ? "undefined" : (0, _typeof3.default)(val)) === "object") {
        onResolve && onResolve(val);
        return val;
      } else {
        throw new Error("Unsupported preset format: " + val + ".");
      }
    });
  };
@fab1an
Copy link

fab1an commented Jun 22, 2016

Do you have a file called .babelrc in one of the parent-folders /Users/hotar Dev or Projects?

@hunterzhang-dev
Copy link
Author

hunterzhang-dev commented Jun 23, 2016

@fab1an Year. It's. Thank you. And I did this

$ npm i babel-preset-react-native --save-dev
$ echo '{"presets": ["react-native"]}' > .babelrc

@RahulBairagi
Copy link

When i try generate android apk of my react project it shows following error. but normally when i run on expo its fine. i have been followed all required procedure when makes android apk.

F:\GeneratAPK _ReactCode\SakeWiz-Native\node_modules\react-throttle\lib\index.js: Couldn't find preset "es2015" relative to directory "F:\GeneratAPK _ReactCode\SakeWiz-Native\node_modules\react-throttle"

:app:bundleReleaseJsAndAssets FAILED

FAILURE: Build failed with an exception.

  • What went wrong:
    Execution failed for task ':app:bundleReleaseJsAndAssets'.

Process 'command 'cmd'' finished with non-zero exit value 1

@anonrig
Copy link

anonrig commented Mar 27, 2018

I'm having the same exact issue.

@facebook facebook locked as resolved and limited conversation to collaborators Jun 23, 2018
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Jul 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests

5 participants