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 "module:metro-react-native-babel-preset"

See original GitHub issue

Environment

React Native Environment Info: System: OS: macOS High Sierra 10.13.6 CPU: x64 Intel® Core™ i7-4750HQ CPU @ 2.00GHz Memory: 68.43 MB / 8.00 GB Shell: 3.2.57 - /bin/bash Binaries: Node: 9.8.0 - /usr/local/bin/node Yarn: 1.9.4 - /usr/local/bin/yarn npm: 6.3.0 - /usr/local/bin/npm SDKs: iOS SDK: Platforms: iOS 12.1, macOS 10.14, tvOS 12.1, watchOS 5.1 IDEs: Xcode: 10.1/10O23u - /usr/bin/xcodebuild npmPackages: react: ^16.5.2 => 16.5.2 react-native: ^0.57.0 => 0.57.0 npmGlobalPackages: create-react-native-app: 1.0.0 react-native-cli: 1.2.0 react-native-git-upgrade: 0.2.7 react-native-rename: 2.2.2

Description

When trying to run “react-native-git-upgrade” it gives the following error: git-upgrade ERR! An error occurred during upgrade: Error: Couldn't find preset "module:metro-react-native-babel-preset" relative to directory "Users/...

Reproducible Demo

Try to upgrade from React Native 0.56 to 0.57 with “react-native-git-upgrade”.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:84
  • Comments:71 (7 by maintainers)

github_iconTop GitHub Comments

112reactions
Amnesthesiacommented, Sep 21, 2018

I seemed to have solved this by removing everything in the babelrc file:

# .babelrc
{
}

react-native-git-upgrade then tries to re-add this during installation. I kept removing it and re-saving the file, and it continued without crashing. Then I added the contents back.

110reactions
rszalskicommented, Oct 5, 2018

@Amnesthesia 's workaround allowed my upgrade to progress a bit further, but eventually react-native-git-upgrade re-added the preset to .babelrc file and failed at the same error in the end.

My solution was to rename .babelrc -> .babelrc2 during upgrade which worked. I restored the .babelrc config after the upgrade.

Happened to me when upgrading v0.57.0 -> v0.57.1 and v0.57.1 -> v0.57.2.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Couldn't find preset "module:metro-react-native-babel-preset ...
I'm trying to run my test suite but I am getting the following error: Couldn ...
Read more >
metro-react-native-babel-preset - npm
Babel presets for React Native applications. React Native itself uses this Babel preset by default when transforming your app's source code. If ...
Read more >
babel/preset-react
When spreading props, use inline object with spread elements directly instead of Babel's extend helper or Object.assign . .babelrc.js. module.exports = { ...
Read more >
Babel error: "Couldn't find preset 'latest' relative to directory ...
[Solved]-Babel error: "Couldn't find preset 'latest' relative to directory" when preset was installed globally-babel.js.
Read more >
jest报错Couldn't find preset "module:metro-react-native-babel ...
使用react-native时,用jest报错Couldn't find preset "module:metro-react-native-babel-preset" relative to directory。
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