Reputation: 15453
I am following this guide: https://facebook.github.io/react-native/docs/upgrading.html
However, I get this printout:
> react-native upgrade 0.59
Scanning folders for symlinks in /Users/danale/Projects/engage-application.mobile/node_modules (18ms)
You should consider using the new upgrade tool based on Git. It makes upgrades easier by resolving most conflicts automatically.
To use it:
- Go back to the old version of React Native
- Run "npm install -g react-native-git-upgrade"
- Run "react-native-git-upgrade"
See https://facebook.github.io/react-native/docs/upgrading.html
Upgrading project to react-native v0.53.3
Check out the release notes and breaking changes: https://github.com/facebook/react-native/releases/tag/v0.53.0
.babelrc has changed in the new version.
Do you want to keep your .babelrc or replace it with the latest version?
If you ever made any changes to this file, you'll probably want to keep it.
You can see the new version here: /Users/danale/Projects/engage-application.mobile/node_modules/react-native/local-cli/templates/HelloWorld/_babelrc
Do you want to replace .babelrc? Answer y to replace, n to keep your version:
I killed the process because I am confused as to why it thinks I am trying to upgrade to a version I already have?
If I try the suggestions in the output, I get this error:
Output:
fatal: working tree '.' already exists.
git-upgrade ERR! An error occurred during upgrade:
git-upgrade ERR! Error: Command 'yarn add [email protected] [email protected]' exited with code 1:
stderr: undefinedwarning package-lock.json found. Your project contains lock files generated by tools other than Yarn. It is advised not to mix package managers in order to avoid resolution inconsistencies caused by unsynchronized lock files. To clear this warning, remove package-lock.json.
warning babel-preset-env > [email protected]: Browserslist 2 could fail on reading Browserslist >3.0 config used in other tools.
error Command failed.
Exit code: 128
Command: git
Arguments: clone https://github.com/jjd314/react-native-swipe-view /Users/danale/Library/Caches/Yarn/v2/.tmp/657474cb39d30bc7457c09c627f92462
Directory: /Users/danale/Projects/engage-application.mobile
Output:
fatal: working tree '.' already exists.
stdout: yarn add v1.10.1
[1/4] Resolving packages...
[2/4] Fetching packages...
info Visit https://yarnpkg.com/en/docs/cli/add for documentation about this command.
at ChildProcess.child.on.code (/usr/local/lib/node_modules/react-native-git-upgrade/cliEntry.js:58:18)
at ChildProcess.emit (events.js:197:13)
at Process.ChildProcess._handle.onexit (internal/child_process.js:254:12)
git-upgrade ERR! Restore initial sources
Note: checking out 'project-snapshot'.
Upvotes: 2
Views: 2329
Reputation: 15238
You are not using the react-native upgrade
command correctly. The guide you've linked to states that you need to:
npm install --save [email protected]
react-native upgrade
Upvotes: 1