Error: Couldn't find preset "module:metro-react-native-babel-preset"
See original GitHub issueEnvironment
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:
- Created 5 years ago
- Reactions:84
- Comments:71 (7 by maintainers)
I seemed to have solved this by removing everything in the
babelrc
file: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.@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
andv0.57.1
->v0.57.2
.